File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
packages/clients/dish/src Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 88} from '../servicesConstants'
99
1010const groupDenkmalsuche = 'groupDenkmalsuche'
11+ export const categoryIdAlkisSearch = 'categoryIdAlkisSearch'
1112
1213export const searchMethods = {
1314 denkmalsucheAutocomplete : {
@@ -80,7 +81,7 @@ export const searchMethods = {
8081 } ,
8182 alkisSearch : {
8283 groupId : groupDenkmalsuche ,
83- categoryId : ' categoryIdAlkisSearch' ,
84+ categoryId : categoryIdAlkisSearch ,
8485 type : 'wfs' ,
8586 // will be set later due to mode setting
8687 url : null ,
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { GeoJSON } from 'ol/format'
99import packageInfo from '../package.json'
1010import { navigateToDenkmal } from './utils/navigateToDenkmal'
1111import { watchActiveMaskIds } from './utils/watchActiveMaksIds'
12+ import { watchSearchResultForAlkisSearch } from './utils/watchSearchResultForAlkisSearch'
1213import { addPlugins } from './addPlugins'
1314import { services } from './services'
1415import { getMapConfiguration } from './mapConfigurations/mapConfig'
@@ -44,6 +45,7 @@ export default {
4445 subscribeToExportedMap ( map )
4546 // watch for changes in activeMaskIds to update beschriftung layer
4647 watchActiveMaskIds ( map )
48+ watchSearchResultForAlkisSearch ( map )
4749 map . $store . commit ( 'plugin/selectionObject/setObjectId' , objektId )
4850 if ( typeof objektId === 'string' ) {
4951 zoomToInternalFeature ( map , objektId , urlParams )
Original file line number Diff line number Diff line change 1+ import { MapInstance } from '@polar/core'
2+ import { categoryIdAlkisSearch } from '../mapConfigurations/searchConfigParams'
3+
4+ export function watchSearchResultForAlkisSearch ( instance : MapInstance ) {
5+ instance . subscribe ( 'plugin/addressSearch/chosenAddress' , ( chosenAddress ) => {
6+ if ( chosenAddress === null ) {
7+ return
8+ }
9+ const configuration =
10+ instance . $store . getters [ 'plugin/addressSearch/addressSearchConfiguration' ]
11+ const configPatternKeys = configuration . searchMethods ?. find (
12+ ( method ) => method . categoryId === categoryIdAlkisSearch
13+ ) . queryParameters ?. patternKeys
14+ const configPatternKeysArray = Object . keys ( configPatternKeys || { } )
15+ const patternKeysSearchResult = Object . keys (
16+ ( chosenAddress as any ) ?. properties || { }
17+ )
18+
19+ if (
20+ configPatternKeysArray . every ( ( item ) =>
21+ patternKeysSearchResult . includes ( item )
22+ )
23+ ) {
24+ console . log ( '### ES KLAPPT' )
25+ }
26+ } )
27+ }
You can’t perform that action at this time.
0 commit comments