forked from MapComplete/MapComplete
Merge branch 'bike-pumps'
This commit is contained in:
commit
b24698513d
35 changed files with 850 additions and 282 deletions
|
@ -121,16 +121,6 @@ export class FilteredLayer {
|
|||
}
|
||||
|
||||
|
||||
public updateStyle() {
|
||||
if (this._geolayer === undefined) {
|
||||
return;
|
||||
}
|
||||
const self = this;
|
||||
this._geolayer.setStyle(function (feature) {
|
||||
return self._style(feature.properties);
|
||||
});
|
||||
}
|
||||
|
||||
public AddNewElement(element) {
|
||||
this._newElements.push(element);
|
||||
console.log("Element added");
|
||||
|
@ -197,7 +187,15 @@ export class FilteredLayer {
|
|||
onEachFeature: function (feature, layer) {
|
||||
let eventSource = self._storage.addOrGetElement(feature);
|
||||
eventSource.addCallback(function () {
|
||||
self.updateStyle();
|
||||
if (layer.setIcon) {
|
||||
layer.setIcon(self._style(feature.properties).icon)
|
||||
} else {
|
||||
console.log("UPdating", layer);
|
||||
|
||||
self._geolayer.setStyle(function (feature) {
|
||||
return self._style(feature.properties);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue