UNPKG

vue-tianditu2

Version:
1 lines 1.61 kB
{"version":3,"file":"index.mjs","sources":["../../../../packages/overlay/markerClusterer/index.ts"],"sourcesContent":["import { defineComponent, onBeforeMount, onUnmounted } from \"vue\";\nimport { useMapRoot } from \"~/use/mapRoot\";\nimport { useEvent } from \"~/use/event\";\nimport { EVENTS, NATIVE_EVENTS, PROPS, useInit, useWatch } from \"./use\";\n\nexport const TdtMarkerClusterer = defineComponent({\n name: \"TdtMarkerClusterer\",\n props: PROPS,\n emits: EVENTS,\n setup(props, { emit }) {\n onBeforeMount(async () => {\n onUnmounted(() => tdtComponent?.clearMarkers());\n\n const tdtMap = await useMapRoot();\n const tdtComponent = useInit(props, tdtMap);\n useEvent({ events: NATIVE_EVENTS, emit, instance: tdtComponent });\n useWatch({ props, instance: tdtComponent });\n emit(\"init\", tdtComponent);\n });\n\n return () => {};\n }\n});\n\nexport type TdtMarkerClustererInstance = InstanceType<typeof TdtMarkerClusterer>;\n"],"names":["TdtMarkerClusterer","defineComponent","PROPS","EVENTS","props","emit","onBeforeMount","onUnmounted","tdtComponent","tdtMap","useMapRoot","useInit","useEvent","NATIVE_EVENTS","useWatch"],"mappings":";;;;;;AAKO,MAAMA,IAAqBC,EAAgB;AAAA,EAChD,MAAM;AAAA,EACN,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,MAAMC,GAAO,EAAE,MAAAC,KAAQ;AACrB,WAAAC,EAAc,YAAY;AACZ,MAAAC,EAAA,MAAMC,KAAA,gBAAAA,EAAc,cAAc;AAExC,YAAAC,IAAS,MAAMC,EAAW,GAC1BF,IAAeG,EAAQP,GAAOK,CAAM;AAC1C,MAAAG,EAAS,EAAE,QAAQC,GAAe,MAAAR,GAAM,UAAUG,GAAc,GAChEM,EAAS,EAAE,OAAAV,GAAO,UAAUI,EAAA,CAAc,GAC1CH,EAAK,QAAQG,CAAY;AAAA,IAAA,CAC1B,GAEM,MAAM;AAAA,IAAC;AAAA,EAAA;AAElB,CAAC;"}