aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbyUtils.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-18 12:22:34 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-18 12:22:34 +0800
commit684203b326392688821d514f69f8d6b954a58b1b (patch)
tree64b6ee58640ea38f5e7da3c0b2d0f7fbcaacda65 /src/dumbyUtils.mjs
parent3bbe5f85aa084e807eba3d380fc077a00af88516 (diff)
feat: show label text of GeoLink by search param or text content
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r--src/dumbyUtils.mjs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs
index b73f5cd..6a77548 100644
--- a/src/dumbyUtils.mjs
+++ b/src/dumbyUtils.mjs
@@ -127,11 +127,12 @@ const getMarkersFromMaps = link => {
127 * @param {Element} target 127 * @param {Element} target
128 */ 128 */
129const addLeaderLine = (link, target) => { 129const addLeaderLine = (link, target) => {
130 const labelText = new URL(link).searchParams.get('text') ?? link.textContent
130 const line = new LeaderLine({ 131 const line = new LeaderLine({
131 start: link, 132 start: link,
132 end: target, 133 end: target,
133 hide: true, 134 hide: true,
134 middleLabel: link.title, 135 middleLabel: labelText,
135 path: 'magnet', 136 path: 'magnet',
136 }) 137 })
137 line.show('draw', { duration: 300 }) 138 line.show('draw', { duration: 300 })