diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-05 14:58:37 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-05 18:58:23 +0800 |
commit | 7ee20b87e0ae47a5220e8e0aad5f56cf8b262f7e (patch) | |
tree | b27243bf28dd3ff2d38752fef05af14f4f8b3132 /src/MenuItem.mjs | |
parent | 849a9ededf3aa90a8a0e7ccd5d752f51f47a6642 (diff) |
style: reformat code
remove mapCallback for now
Diffstat (limited to 'src/MenuItem.mjs')
-rw-r--r-- | src/MenuItem.mjs | 10 |
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 | |||
346 | export const getCoordinatesByPixels = (map, xy) => | ||
347 | new Item({ | ||
348 | text: 'Get Coordinates', | ||
349 | onclick: () => console.log(map.renderer.unproject(xy)) | ||
350 | }) | ||