diff --git a/src/leaflet/control/LinkControl.ts b/src/leaflet/control/LinkControl.ts index 220eac2..e249d93 100644 --- a/src/leaflet/control/LinkControl.ts +++ b/src/leaflet/control/LinkControl.ts @@ -20,7 +20,7 @@ import {Control, ControlOptions, DomUtil, Map} from 'leaflet'; import {useStore} from "@/store"; import '@/assets/icons/link.svg'; -import ClipboardJS from 'clipboard'; +import { toClipboard } from '@soerenmartius/vue3-clipboard' export class LinkControl extends Control { // @ts-ignore @@ -42,8 +42,9 @@ export class LinkControl extends Control { `; - new ClipboardJS(linkButton, { - text: () => window.location.href.split("#")[0] + useStore().getters.url, + linkButton.addEventListener('click', e => { + e.preventDefault(); + toClipboard(window.location.href.split("#")[0] + useStore().getters.url); }); return linkButton;