vue-tianditu2
Version:
1 lines • 1.71 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../packages/tilelayer/wms/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 TdtTilelayerWms = defineComponent({\n name: \"TdtTilelayerWms\",\n props: PROPS,\n emits: EVENTS,\n setup(props, { emit, attrs }) {\n onBeforeMount(async () => {\n onUnmounted(() => tdtComponent && tdtMap?.removeLayer(tdtComponent));\n\n const tdtMap = await useMapRoot();\n const tdtComponent = useInit(props, attrs);\n tdtMap.addLayer(tdtComponent);\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 TdtTilelayerWmsInstance = InstanceType<typeof TdtTilelayerWms>;\n"],"names":["TdtTilelayerWms","defineComponent","PROPS","EVENTS","props","emit","attrs","onBeforeMount","onUnmounted","tdtComponent","tdtMap","useMapRoot","useInit","useEvent","NATIVE_EVENTS","useWatch"],"mappings":";;;;;;AAKO,MAAMA,IAAkBC,EAAgB;AAAA,EAC7C,MAAM;AAAA,EACN,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,MAAMC,GAAO,EAAE,MAAAC,GAAM,OAAAC,KAAS;AAC5B,WAAAC,EAAc,YAAY;AACxB,MAAAC,EAAY,MAAMC,MAAgBC,KAAA,gBAAAA,EAAQ,YAAYD,GAAa;AAE7D,YAAAC,IAAS,MAAMC,EAAW,GAC1BF,IAAeG,EAAQR,GAAOE,CAAK;AACzC,MAAAI,EAAO,SAASD,CAAY,GAC5BI,EAAS,EAAE,QAAQC,GAAe,MAAAT,GAAM,UAAUI,GAAc,GAChEM,EAAS,EAAE,OAAAX,GAAO,UAAUK,EAAA,CAAc,GAC1CJ,EAAK,QAAQI,CAAY;AAAA,IAAA,CAC1B,GAEM,MAAM;AAAA,IAAC;AAAA,EAAA;AAElB,CAAC;"}