{"version":3,"file":"LaserLayer.vue2.mjs","sources":["../../../../packages/LaserLayer/LaserLayer.vue"],"sourcesContent":["<template>\r\n  <div />\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport {defineOptions} from 'vue';\r\nimport {useRegister} from \"@vuemap/vue-amap\";\r\nimport {buildLocaProps, commonEmitNames} from \"../../utils/buildHelper\";\r\nimport {useWatchFn, useLocaEvents} from '../../mixins/useLoca';\r\n\r\ndefineOptions({\r\n  name: 'ElAmapLocaLaser',\r\n  inheritAttrs: false\r\n});\r\n\r\nconst props = defineProps(buildLocaProps({\r\n  depth: {\r\n    type: Boolean,\r\n    default: true\r\n  }// 图层中的要素是否具有前后遮盖关系，默认开启\r\n}));\r\nconst emits = defineEmits(commonEmitNames);\r\n\r\nlet $amapComponent: any;\r\n\r\nlet _destroyComponent: () => void;\r\nlet _setSource: () => void;\r\n\r\nconst {$$getInstance, parentInstance} = useRegister<Loca.LaserLayer, Loca.Container>((options) => {\r\n  return new Promise<any>((resolve) => {\r\n    $amapComponent = new Loca.LaserLayer(options);\r\n    const useResult = useLocaEvents({\r\n      parentInstance,\r\n      $amapComponent,\r\n      emits,\r\n      props,\r\n      setStyle () {\r\n        const defaultStyleValue = {\r\n          unit: 'px',\r\n          height: 200,\r\n          color: 'rgba(255,255,0,0.5)',\r\n          angle: 0,\r\n          lineWidth: 2,\r\n          trailLength: 30,\r\n          duration: 2000,\r\n          interval: 0,\r\n          delay: 0,\r\n          repeat: undefined\r\n        };\r\n        const style = Object.assign({}, defaultStyleValue, props.defaultStyleValue);\r\n        const defaultLayerStyle = {\r\n          unit: style.unit,\r\n          height: (index, feature) => {\r\n            feature.properties = feature.properties || {};\r\n            return feature.properties.height === undefined ? style.height : feature.properties.height;\r\n          },\r\n          color: (index, feature) => {\r\n            feature.properties = feature.properties || {};\r\n            return feature.properties.color === undefined ? style.color : feature.properties.color;\r\n          },\r\n          angle: style.angle,\r\n          lineWidth: style.lineWidth,\r\n          trailLength: style.trailLength,\r\n          duration: (index, feature) => {\r\n            feature.properties = feature.properties || {};\r\n            return feature.properties.duration === undefined ? style.duration : feature.properties.duration;\r\n          },\r\n          interval: (index, feature) => {\r\n            feature.properties = feature.properties || {};\r\n            return feature.properties.interval === undefined ? style.interval : feature.properties.interval;\r\n          },\r\n          delay: (index, feature) => {\r\n            feature.properties = feature.properties || {};\r\n            return feature.properties.delay === undefined ? style.delay : feature.properties.delay;\r\n          },\r\n          repeat: style.repeat\r\n        };\r\n        const layerStyle = Object.assign({}, defaultLayerStyle, props.layerStyle);\r\n        $amapComponent.setStyle(layerStyle);\r\n      },\r\n    });\r\n    _destroyComponent = useResult._destroyComponent;\r\n    _setSource = useResult.setSource;\r\n    resolve($amapComponent);\r\n  });\r\n\r\n}, {\r\n  emits,\r\n  watchRedirectFn: useWatchFn({\r\n    setSource (){\r\n      if(_setSource){\r\n        _setSource();\r\n      }\r\n    },\r\n    $amapComponent: () => $amapComponent,\r\n    props\r\n  }),\r\n  destroyComponent () {\r\n    if(_destroyComponent){\r\n      _destroyComponent();\r\n    }\r\n    $amapComponent = null;\r\n  },\r\n});\r\n\r\ndefineExpose({\r\n  $$getInstance,\r\n});\r\n\r\n</script>\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAMd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAI,IAAA,cAAA,CAAA;AAEJ,IAAI,IAAA,iBAAA,CAAA;AACJ,IAAI,IAAA,UAAA,CAAA;AAEJ,IAAA,MAAM,EAAC,aAAe,EAAA,cAAA,EAAkB,GAAA,WAAA,CAA6C,CAAC,OAAY,KAAA;AAChG,MAAO,OAAA,IAAI,OAAa,CAAA,CAAC,OAAY,KAAA;AACnC,QAAiB,cAAA,GAAA,IAAI,IAAK,CAAA,UAAA,CAAW,OAAO,CAAA,CAAA;AAC5C,QAAA,MAAM,YAAY,aAAc,CAAA;AAAA,UAC9B,cAAA;AAAA,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