Feature(pwa): add protocol handler

This commit is contained in:
Pieter Vander Vennet 2025-06-16 02:33:37 +02:00
parent 50c2abebdf
commit de74a5dc08
4 changed files with 43 additions and 17 deletions

View file

@ -16,24 +16,25 @@ export class WithSearchState extends WithVisualFeedbackState {
super(theme, mvtAvailableLayers)
this.searchState = new SearchState(this)
this.initHotkeysSearch()
this.displaySearchLayer()
{
// Register the search layer on the map
}
const source = this.searchState.locationResults
const flayer = this.layerState.filteredLayers.get("search")
this.featureProperties.trackFeatureSource(source)
const options: ShowDataLayerOptions & { layer: LayerConfig } = {
features: source,
doShowLayer: flayer.isDisplayed,
layer: flayer.layerDef,
metaTags: this.userRelatedState.preferencesAsTags,
onClick: (feature) => {
this.searchState.clickedOnMap(feature)
},
}
new ShowDataLayer(this.map, options)
private displaySearchLayer() {
const source = this.searchState.locationResults
const flayer = this.layerState.filteredLayers.get("search")
this.featureProperties.trackFeatureSource(source)
const options: ShowDataLayerOptions & { layer: LayerConfig } = {
features: source,
doShowLayer: flayer.isDisplayed,
layer: flayer.layerDef,
metaTags: this.userRelatedState.preferencesAsTags,
onClick: (feature) => {
this.searchState.clickedOnMap(feature)
},
}
new ShowDataLayer(this.map, options)
}
private initHotkeysSearch() {