aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbyUtils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r--src/dumbyUtils.mjs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs
index e8fb982..c0f4a0a 100644
--- a/src/dumbyUtils.mjs
+++ b/src/dumbyUtils.mjs
@@ -163,7 +163,7 @@ export const createGeoLink = (link) => {
163 163
164 link.lines = [] 164 link.lines = []
165 165
166 // LeaderLine 166 // Hover link for LeaderLine
167 link.onmouseover = () => { 167 link.onmouseover = () => {
168 if (link.dataset.valid === 'false') return 168 if (link.dataset.valid === 'false') return
169 169
@@ -176,6 +176,8 @@ export const createGeoLink = (link) => {
176 }) 176 })
177 } 177 }
178 link.onmouseout = () => removeLeaderLines(link) 178 link.onmouseout = () => removeLeaderLines(link)
179
180 // Click to move camera
179 link.onclick = (event) => { 181 link.onclick = (event) => {
180 event.preventDefault() 182 event.preventDefault()
181 if (link.dataset.valid === 'false') return 183 if (link.dataset.valid === 'false') return
@@ -187,6 +189,15 @@ export const createGeoLink = (link) => {
187 Number(link.dataset.lat), 189 Number(link.dataset.lat),
188 ])) 190 ]))
189 } 191 }
192
193 // Use middle click to remove markers
194 link.onauxclick = (e) => {
195 if (e.which !== 2) return
196 e.preventDefault()
197 removeLeaderLines(link)
198 getMarkersFromMaps(link)
199 .forEach(marker => marker.remove())
200 }
190 return true 201 return true
191} 202}
192 203