Wire up the zoom on the map
This commit is contained in:
parent
f0fcfe548e
commit
250a3cbf58
2 changed files with 13 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ class MapLocator extends HTMLElement {
|
|||
*/
|
||||
this._map.on("load", () => {
|
||||
console.log("map loaded");
|
||||
this.dispatchEvent(new CustomEvent('load'), {
|
||||
this.dispatchEvent(new CustomEvent("load"), {
|
||||
bubbles: true,
|
||||
composed: true, // Allows event to cross shadow DOM boundary
|
||||
detail: {
|
||||
|
|
@ -65,6 +65,13 @@ class MapLocator extends HTMLElement {
|
|||
}
|
||||
});
|
||||
});
|
||||
this._map.on("zoomend", (e) => {
|
||||
this.dispatchEvent(new CustomEvent("zoomend"), {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
detail: e,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Initial render of component
|
||||
|
|
@ -100,6 +107,10 @@ class MapLocator extends HTMLElement {
|
|||
`;
|
||||
}
|
||||
|
||||
GetZoom() {
|
||||
return this._map.getZoom();
|
||||
}
|
||||
|
||||
JumpTo(args) {
|
||||
this._map.jumpTo(args);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue