forked from MapComplete/MapComplete
Add live updating of icons on the map
This commit is contained in:
parent
f2d9eb8992
commit
4f7c25766a
2 changed files with 35 additions and 22 deletions
|
@ -129,13 +129,17 @@ export class FilteredLayer {
|
|||
|
||||
let self = this;
|
||||
this._geolayer = L.geoJSON(data, {
|
||||
style: feature =>
|
||||
self.layerDef.GenerateLeafletStyle(feature.properties, self._showOnPopup !== undefined),
|
||||
style: feature => {
|
||||
const tagsSource = State.state.allElements.getElement(feature.properties.id);
|
||||
return self.layerDef.GenerateLeafletStyle(tagsSource, self._showOnPopup !== undefined);
|
||||
},
|
||||
pointToLayer: function (feature, latLng) {
|
||||
// Point to layer converts the 'point' to a layer object - as the geojson layer natively cannot handle points
|
||||
// Click handling is done in the next step
|
||||
|
||||
const tagSource = State.state.allElements.getElement(feature.properties.id);
|
||||
|
||||
const style = self.layerDef.GenerateLeafletStyle(feature.properties, self._showOnPopup !== undefined);
|
||||
const style = self.layerDef.GenerateLeafletStyle(tagSource, self._showOnPopup !== undefined);
|
||||
let marker;
|
||||
if (style.icon === undefined) {
|
||||
marker = L.circle(latLng, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue