aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/MenuItem.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/MenuItem.mjs')
-rw-r--r--src/MenuItem.mjs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/MenuItem.mjs b/src/MenuItem.mjs
index 1b58e0b..dbe984f 100644
--- a/src/MenuItem.mjs
+++ b/src/MenuItem.mjs
@@ -9,9 +9,9 @@ export class Item extends window.HTMLDivElement {
9 /** 9 /**
10 * constructor. 10 * constructor.
11 * 11 *
12 * @param {} 12 * @param {Object}
13 */ 13 */
14 constructor ({ text, innerHTML, onclick, style, className, onmouseover }) { 14 constructor ({ text, innerHTML, onclick, style, className }) {
15 super() 15 super()
16 this.innerHTML = innerHTML ?? text 16 this.innerHTML = innerHTML ?? text
17 this.onclick = onclick 17 this.onclick = onclick
@@ -342,3 +342,9 @@ export const toggleMapFocus = map =>
342 text: 'Toggle Focus', 342 text: 'Toggle Focus',
343 onclick: () => map.classList.toggle('focus') 343 onclick: () => map.classList.toggle('focus')
344 }) 344 })
345
346export const getCoordinatesByPixels = (map, xy) =>
347 new Item({
348 text: 'Get Coordinates',
349 onclick: () => console.log(map.renderer.unproject(xy))
350 })