We provide an addPopup() method on map instances, which initializes a new Popup and dispatches a custom farmOS-map.popup event when a singleclick is performed on the map. However, it doesn't pass the click coordinate into the farmOS-map.popup, so that coordinate isn't available to other behaviors who want to hook into the popup display.
For example, the event on this line:
https://github.com/farmOS/farmOS/blob/fc77c86abe6b142702e7b103cd85e0c207333b79/modules/core/ui/map/js/farmOS.map.behaviors.asset_type_layers.js#L91
Is NOT the same event as this one:
|
popup.show(event.coordinate, content); |
... so event.coordinate is not accessible in the downstream behavior.
We provide an
addPopup()method on map instances, which initializes a newPopupand dispatches a customfarmOS-map.popupevent when asingleclickis performed on the map. However, it doesn't pass the click coordinate into thefarmOS-map.popup, so that coordinate isn't available to other behaviors who want to hook into the popup display.For example, the
eventon this line:https://github.com/farmOS/farmOS/blob/fc77c86abe6b142702e7b103cd85e0c207333b79/modules/core/ui/map/js/farmOS.map.behaviors.asset_type_layers.js#L91
Is NOT the same
eventas this one:farmOS-map/src/instance/methods/popup.js
Line 16 in 777758f
... so
event.coordinateis not accessible in the downstream behavior.