forked from MapComplete/MapComplete
Add some tweaks to hide the add-poi-marker when a layer is enabled
This commit is contained in:
parent
77e065d6e7
commit
15f816e172
5 changed files with 30 additions and 8 deletions
|
@ -15,6 +15,16 @@ export class StrayClickHandler {
|
|||
this._uiToShow = uiToShow;
|
||||
const self = this;
|
||||
const map = State.state.bm.map;
|
||||
State.state.filteredLayers.data.forEach((filteredLayer) => {
|
||||
filteredLayer.isDisplayed.addCallback(isEnabled => {
|
||||
if(isEnabled){
|
||||
// When a layer is activated, we remove the 'last click location' in order to force the user to reclick
|
||||
// This reclick might be at a location where a feature now appeared...
|
||||
map.removeLayer(self._lastMarker);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
State.state.bm.LastClickLocation.addCallback(function (lastClick) {
|
||||
State.state.selectedElement.setData(undefined);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue