UNPKG

@vuemap/vue-amap

Version:

高德地图vue3版本封装

83 lines (78 loc) 2.44 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../../mixins/index.js'); require('../../../../utils/index.js'); var buildHelper = require('../../../../utils/buildHelper.js'); var useRegister = require('../../../../mixins/useRegister.js'); var script = /* @__PURE__ */ vue.defineComponent({ ...{ name: "ElAmapLayerHeatMap", inheritAttrs: false }, __name: "HeatMap", props: buildHelper.buildProps({ radius: { type: Number }, // 热力图中单个点的半径,默认:30,单位:pixel gradient: { type: Object }, // 热力图的渐变区间,热力图按照设置的颜色及间隔显示热力图,例{0.4:'rgb(0, 255, 255)',0.85:'rgb(100, 0, 255)',},其中 key 表示间隔位置,取值范围: [0,1] ,value 为颜色值。默认:heatmap.js标准配色方案 zooms: { type: Array }, // 支持的缩放级别范围,默认范围 [2-30] opacity: { type: Object }, // 热力图透明度区间数组,取值范围 [0,1] ,0表示完全透明,1表示不透明,默认: [0,1] config: { type: Object }, // 3D热力图属性 dataSet: { type: Object } // 热力图数据集 }), emits: ["init"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emits = __emit; let $amapComponent; const { $$getInstance, parentInstance } = useRegister.useRegister((options, parentComponent) => { return new Promise((resolve) => { AMap.plugin(["AMap.HeatMap"], () => { delete options.dataSet; $amapComponent = new AMap.HeatMap(parentComponent, options); if (props.dataSet) { $amapComponent.setDataSet(props.dataSet); } resolve($amapComponent); }); }); }, { emits, destroyComponent() { if ($amapComponent && (parentInstance == null ? void 0 : parentInstance.$amapComponent)) { $amapComponent.setDataSet({ data: [], max: 0 }); $amapComponent.setMap(null); $amapComponent = null; } } }); __expose({ $$getInstance }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div"); }; } }); exports.default = script; //# sourceMappingURL=HeatMap.vue2.js.map