forked from MapComplete/MapComplete
Feature(pwa): add protocol handler
This commit is contained in:
parent
50c2abebdf
commit
de74a5dc08
4 changed files with 43 additions and 17 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue