Set marker on click on aerial imagery

This commit is contained in:
Eli Ribble 2026-03-11 15:12:59 +00:00
parent 5e7c547670
commit 289fac1e7e
No known key found for this signature in database
2 changed files with 27 additions and 7 deletions

View file

@ -90,6 +90,20 @@ class MapProxiedArcgisTile extends HTMLElement {
map: this,
},
});
this._map.on("click", (e) => {
this.dispatchEvent(
new CustomEvent("map-click", {
bubbles: true,
composed: true,
detail: {
lng: e.lngLat.lng,
lat: e.lngLat.lat,
map: this,
point: e.point,
},
}),
);
});
});
for (const on of this._preOns) {
this._map.on(on.a, on.b);