Fix bug with add buttons not always working

This commit is contained in:
Pieter Vander Vennet 2020-07-20 16:37:19 +02:00
parent dc0da41fb1
commit c688c42258

View file

@ -32,15 +32,16 @@ export class StrayClickHandler {
self._lastMarker = L.marker([lastClick.lat, lastClick.lon]); self._lastMarker = L.marker([lastClick.lat, lastClick.lon]);
const uiElement = uiToShow(); const uiElement = uiToShow();
const popup = L.popup().setContent(uiElement.Render()); const popup = L.popup().setContent(uiElement.Render());
uiElement.Activate();
uiElement.Update(); uiElement.Update();
uiElement.Activate();
self._lastMarker.addTo(map); self._lastMarker.addTo(map);
self._lastMarker.bindPopup(popup).openPopup(); self._lastMarker.bindPopup(popup).openPopup();
self._lastMarker.on("click", () => { self._lastMarker.on("click", () => {
leftMessage.setData(self._uiToShow); leftMessage.setData(self._uiToShow);
}); });
uiElement.Update();
uiElement.Activate();
}); });
selectElement.addCallback(() => { selectElement.addCallback(() => {