vue-tianditu2
Version:
1 lines • 1.7 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../packages/overlay/rectangle/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 TdtRectangle = defineComponent({\n name: \"TdtRectangle\",\n props: PROPS,\n emits: EVENTS,\n setup(props, { emit }) {\n onBeforeMount(async () => {\n onUnmounted(() => tdtComponent && tdtMap?.removeOverLay(tdtComponent));\n\n const tdtMap = await useMapRoot();\n const tdtComponent = useInit(props);\n tdtMap.addOverLay(tdtComponent);\n useEvent({ events: NATIVE_EVENTS, emit, instance: tdtComponent, extData: props.extData });\n useWatch({ props, instance: tdtComponent });\n emit(\"init\", tdtComponent);\n });\n\n return () => {};\n }\n});\n\nexport type TdtRectangleInstance = InstanceType<typeof TdtRectangle>;\n"],"names":["TdtRectangle","defineComponent","PROPS","EVENTS","props","emit","onBeforeMount","onUnmounted","tdtComponent","tdtMap","useMapRoot","useInit","useEvent","NATIVE_EVENTS","useWatch"],"mappings":";;;;;;AAKO,MAAMA,IAAeC,EAAgB;AAAA,EAC1C,MAAM;AAAA,EACN,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,MAAMC,GAAO,EAAE,MAAAC,KAAQ;AACrB,WAAAC,EAAc,YAAY;AACxB,MAAAC,EAAY,MAAMC,MAAgBC,KAAA,gBAAAA,EAAQ,cAAcD,GAAa;AAE/D,YAAAC,IAAS,MAAMC,EAAW,GAC1BF,IAAeG,EAAQP,CAAK;AAClC,MAAAK,EAAO,WAAWD,CAAY,GACrBI,EAAA,EAAE,QAAQC,GAAe,MAAAR,GAAM,UAAUG,GAAc,SAASJ,EAAM,SAAS,GACxFU,EAAS,EAAE,OAAAV,GAAO,UAAUI,EAAA,CAAc,GAC1CH,EAAK,QAAQG,CAAY;AAAA,IAAA,CAC1B,GAEM,MAAM;AAAA,IAAC;AAAA,EAAA;AAElB,CAAC;"}