Add deploy script, fix realtime updating of the icons
This commit is contained in:
parent
07afc597c9
commit
7c1c9bc80a
1 changed files with 9 additions and 11 deletions
|
@ -110,16 +110,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) {
|
public AddNewElement(element) {
|
||||||
this._newElements.push(element);
|
this._newElements.push(element);
|
||||||
console.log("Element added");
|
console.log("Element added");
|
||||||
|
@ -186,7 +176,15 @@ export class FilteredLayer {
|
||||||
onEachFeature: function (feature, layer) {
|
onEachFeature: function (feature, layer) {
|
||||||
let eventSource = self._storage.addOrGetElement(feature);
|
let eventSource = self._storage.addOrGetElement(feature);
|
||||||
eventSource.addCallback(function () {
|
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…
Reference in a new issue