@vuemap/vue-amap
Version:
高德地图vue3版本封装
80 lines (75 loc) • 2.31 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
require('../../../mixins/index.js');
var buildHelper = require('../../../utils/buildHelper.js');
var useRegister = require('../../../mixins/useRegister.js');
var script = /* @__PURE__ */ vue.defineComponent({
...{
name: "ElAmapLabelMarker",
inheritAttrs: false
},
__name: "LabelMarker",
props: buildHelper.buildProps({
name: {
type: String
},
// 标注名称,作为标注标识,并非最终在地图上显示的文字内容,显示文字内容请设置 opts.text.content
position: {
type: [Array, Object],
required: true
},
// 标注位置
zooms: {
type: Array
},
// 点标记显示的层级范围,超过范围不显示。默认值:zooms: [2, 20]
opacity: {
type: Number
},
// 标注透明度,默认值: 1
rank: {
type: Number
},
// 避让优先级,获取标注的优先级,该优先级用于 labelsLayer 支持避让时,rank 值大的标注会避让掉 rank 值低的标注。默认值:1
icon: {
type: Object
},
// 标注图标设置
text: {
type: Object
},
// 标注文本设置
extData: null
}),
emits: ["init"],
setup(__props, { expose: __expose, emit: __emit }) {
const emits = __emit;
let $amapComponent;
const { $$getInstance, parentInstance } = useRegister.useRegister((options, parentComponent) => {
return new Promise((resolve) => {
$amapComponent = new AMap.LabelMarker(options);
parentComponent.add($amapComponent);
resolve($amapComponent);
});
}, {
emits,
destroyComponent() {
if ($amapComponent && (parentInstance == null ? void 0 : parentInstance.$amapComponent)) {
if (!(parentInstance == null ? void 0 : parentInstance.isDestroy)) {
parentInstance == null ? void 0 : parentInstance.$amapComponent.remove($amapComponent);
}
$amapComponent = null;
}
}
});
__expose({
$$getInstance
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div");
};
}
});
exports.default = script;
//# sourceMappingURL=LabelMarker.vue2.js.map