diff options
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r-- | src/dumbyUtils.mjs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index 1993b02..c4f8d74 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -92,7 +92,7 @@ export function removeBlockFocus () { | |||
92 | * @param {Number[]} options.point - page XY | 92 | * @param {Number[]} options.point - page XY |
93 | * @param {HTMLElement} options.map | 93 | * @param {HTMLElement} options.map |
94 | */ | 94 | */ |
95 | export const addMarkerByPoint = ({ point, map }) => { | 95 | export const addMarkerByPoint = ({ point, map, title }) => { |
96 | const rect = map.getBoundingClientRect() | 96 | const rect = map.getBoundingClientRect() |
97 | const [lon, lat] = map.renderer | 97 | const [lon, lat] = map.renderer |
98 | .unproject([point[0] - rect.left, point[1] - rect.top]) | 98 | .unproject([point[0] - rect.left, point[1] - rect.top]) |
@@ -102,6 +102,7 @@ export const addMarkerByPoint = ({ point, map }) => { | |||
102 | xy: [lon, lat], | 102 | xy: [lon, lat], |
103 | }) | 103 | }) |
104 | marker.dataset.xy = `${lon},${lat}` | 104 | marker.dataset.xy = `${lon},${lat}` |
105 | if (title) marker.title = title | ||
105 | 106 | ||
106 | return marker | 107 | return marker |
107 | } | 108 | } |