Merge branch 'bike-pumps'

This commit is contained in:
Pieter Vander Vennet 2020-07-16 17:24:30 +02:00
commit b24698513d
35 changed files with 850 additions and 282 deletions

View file

@ -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);
});
}
});