@cn-map/gaode-vue 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,4717 @@
1
+ import { a as toDefinedRaw, i as shallowReactiveOmit, n as useMap, o as use_event_listeners_default, r as useMapInstance, t as setMapContext } from "./context-BEyZOuBr.js";
2
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createPropsRestProxy, defineComponent, inject, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderSlot, shallowReactive, shallowRef, toRaw, toValue, unref, useId, useSlots, useTemplateRef, watch, watchEffect, withCtx } from "vue";
3
+ import { LoadStatus, getAPIStatus, load, reset, subscribeAPIStatus } from "@cn-map/gaode-jsapi-loader";
4
+ import { clone, logger, lostContextError, lowercase } from "@cn-map/gaode-shared/utils";
5
+ import { add, addNode, adjust, click, close, complete, dblClick, dragEnd, dragStart, dragging, draw, end, error, hide, hotspotClick, hotspotOut, hotspotOver, mapMove, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, move, moveAlong, moveEnd, moveStart, moving, open, pitchChange, pitchEnd, pitchStart, removeNode, resize, rightClick, rotateChange, rotateEnd, rotateStart, show, touchEnd, touchMove, touchStart, viewChange, zoomChange, zoomEnd, zoomStart } from "@cn-map/gaode-shared/const";
6
+ import { patchContextMenu, patchMap, patchPolygonEditor } from "@cn-map/gaode-shared/patch";
7
+ // src/api-loader/context.ts
8
+ const status = shallowRef({ ...getAPIStatus() });
9
+ subscribeAPIStatus(() => {
10
+ status.value = { ...getAPIStatus() };
11
+ });
12
+ function useAPIStatus(type) {
13
+ return computed(() => type ? status.value[type] : status.value);
14
+ }
15
+ // src/api-loader/use-api-loader.ts
16
+ /**
17
+ * 加载高德地图依赖的 Hook
18
+ * @param {ShallowReactive<APILoaderOptions>} config - 加载高德地图API的配置项
19
+ * @param {boolean} [resetOnUnmounted=false] - 组件卸载时是否重置全局 JSAPI 状态
20
+ */
21
+ const useAPILoader = (config, resetOnUnmounted = false) => {
22
+ const error = shallowRef(null);
23
+ onMounted(() => {
24
+ watch(() => ({
25
+ ...config,
26
+ key: config.apiKey
27
+ }), (val) => {
28
+ load(val).catch((err) => {
29
+ if (err instanceof Error || err instanceof Event) error.value = err;
30
+ else throw new Error(`Unexpected error when loading API`, { cause: err });
31
+ });
32
+ }, { immediate: true });
33
+ });
34
+ onUnmounted(() => {
35
+ if (resetOnUnmounted) reset();
36
+ });
37
+ return {
38
+ status: useAPIStatus(),
39
+ error: computed(() => error.value)
40
+ };
41
+ };
42
+ // src/api-loader/api-loader.vue
43
+ var api_loader_default = /* @__PURE__ */ defineComponent({
44
+ name: "APILoader",
45
+ inheritAttrs: false,
46
+ __name: "api-loader",
47
+ props: {
48
+ resetOnUnmounted: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ apiKey: {},
53
+ version: {},
54
+ plugins: {},
55
+ AMapUI: {},
56
+ Loca: {}
57
+ },
58
+ setup(__props) {
59
+ const props = createPropsRestProxy(__props, ["resetOnUnmounted"]);
60
+ const { status, error } = useAPILoader(props, __props.resetOnUnmounted);
61
+ return (_ctx, _cache) => {
62
+ return renderSlot(_ctx.$slots, "default", {
63
+ status: unref(status),
64
+ error: unref(error)
65
+ });
66
+ };
67
+ }
68
+ });
69
+ // src/composables/use-instance.ts
70
+ var use_instance_default = (key) => {
71
+ const componentRef = useTemplateRef(key);
72
+ return computed(() => componentRef.value?.instance);
73
+ };
74
+ // src/map/map.vue?vue&type=script&setup=true&lang.ts
75
+ const _hoisted_1 = ["id"];
76
+ // src/map/map.vue
77
+ var map_default = /* @__PURE__ */ defineComponent({
78
+ name: "AMap.Map",
79
+ inheritAttrs: false,
80
+ __name: "map",
81
+ props: {
82
+ immediately: {
83
+ type: [Boolean, Object],
84
+ default: void 0
85
+ },
86
+ duration: {},
87
+ container: {},
88
+ asyncOverlay: {
89
+ type: Boolean,
90
+ default: void 0
91
+ },
92
+ backgroundColor: {},
93
+ buildingColor: {},
94
+ cacheSize: {},
95
+ center: {},
96
+ defaultCursor: {},
97
+ labelRejectMask: {
98
+ type: Boolean,
99
+ default: void 0
100
+ },
101
+ langForeign: {},
102
+ languageCode: {},
103
+ layers: {},
104
+ limitBounds: {},
105
+ mask: {},
106
+ overseaDataType: {},
107
+ pitch: {},
108
+ poiIcon: {},
109
+ roofColor: {},
110
+ rotation: {},
111
+ showLabel: {
112
+ type: Boolean,
113
+ default: void 0
114
+ },
115
+ showOversea: {
116
+ type: Boolean,
117
+ default: void 0
118
+ },
119
+ showIndoorMap: {
120
+ type: Boolean,
121
+ default: void 0
122
+ },
123
+ skyColor: {},
124
+ terrain: {
125
+ type: Boolean,
126
+ default: void 0
127
+ },
128
+ vdataProxy: {},
129
+ vectorMapForeign: {
130
+ type: [Boolean, String],
131
+ default: void 0
132
+ },
133
+ viewMode: {},
134
+ wallColor: {},
135
+ WebGLParams: {},
136
+ zoom: {},
137
+ zooms: {},
138
+ allBubble: {
139
+ type: Boolean,
140
+ default: void 0
141
+ },
142
+ animateEnable: {
143
+ type: Boolean,
144
+ default: void 0
145
+ },
146
+ doubleClickZoom: {
147
+ type: Boolean,
148
+ default: void 0
149
+ },
150
+ dragEnable: {
151
+ type: Boolean,
152
+ default: void 0
153
+ },
154
+ features: {},
155
+ isHotspot: {
156
+ type: Boolean,
157
+ default: void 0
158
+ },
159
+ jogEnable: {
160
+ type: Boolean,
161
+ default: void 0
162
+ },
163
+ keyboardEnable: {
164
+ type: Boolean,
165
+ default: void 0
166
+ },
167
+ mapStyle: {},
168
+ pickWhenMoving: {
169
+ type: Boolean,
170
+ default: void 0
171
+ },
172
+ pitchEnable: {
173
+ type: Boolean,
174
+ default: void 0
175
+ },
176
+ rotateEnable: {
177
+ type: Boolean,
178
+ default: void 0
179
+ },
180
+ scrollWheel: {
181
+ type: Boolean,
182
+ default: void 0
183
+ },
184
+ showBuildingBlock: {
185
+ type: Boolean,
186
+ default: void 0
187
+ },
188
+ touchZoom: {
189
+ type: Boolean,
190
+ default: void 0
191
+ },
192
+ touchZoomCenter: {},
193
+ zoomEnable: {
194
+ type: Boolean,
195
+ default: void 0
196
+ },
197
+ zoomSpeed: {}
198
+ },
199
+ emits: [
200
+ "click",
201
+ "complete",
202
+ "dblClick",
203
+ "dragEnd",
204
+ "dragging",
205
+ "dragStart",
206
+ "hotspotClick",
207
+ "hotspotOut",
208
+ "hotspotOver",
209
+ "mapMove",
210
+ "mouseDown",
211
+ "mouseMove",
212
+ "mouseOut",
213
+ "mouseOver",
214
+ "mouseUp",
215
+ "mouseWheel",
216
+ "moveEnd",
217
+ "moveStart",
218
+ "pitchChange",
219
+ "pitchEnd",
220
+ "pitchStart",
221
+ "resize",
222
+ "rightClick",
223
+ "rotateChange",
224
+ "rotateEnd",
225
+ "rotateStart",
226
+ "touchEnd",
227
+ "touchMove",
228
+ "touchStart",
229
+ "viewChange",
230
+ "zoomChange",
231
+ "zoomEnd",
232
+ "zoomStart"
233
+ ],
234
+ setup(__props, { expose: __expose, emit: __emit }) {
235
+ const props = __props;
236
+ const emits = __emit;
237
+ const mapEvents = [
238
+ click,
239
+ complete,
240
+ dblClick,
241
+ dragEnd,
242
+ dragging,
243
+ dragStart,
244
+ hotspotClick,
245
+ hotspotOut,
246
+ hotspotOver,
247
+ mapMove,
248
+ viewChange,
249
+ mouseDown,
250
+ mouseMove,
251
+ mouseOut,
252
+ mouseOver,
253
+ mouseUp,
254
+ mouseWheel,
255
+ moveEnd,
256
+ moveStart,
257
+ pitchChange,
258
+ pitchEnd,
259
+ pitchStart,
260
+ resize,
261
+ rightClick,
262
+ rotateChange,
263
+ rotateEnd,
264
+ rotateStart,
265
+ touchEnd,
266
+ touchMove,
267
+ touchStart,
268
+ zoomChange,
269
+ zoomEnd,
270
+ zoomStart
271
+ ];
272
+ const mapSetOptions = [
273
+ ["center", "setCenter"],
274
+ ["pitch", "setPitch"],
275
+ ["rotation", "setRotation"],
276
+ ["zoom", "setZoom"]
277
+ ];
278
+ const mapStatusKeys = [
279
+ "allBubble",
280
+ "animateEnable",
281
+ "doubleClickZoom",
282
+ "dragEnable",
283
+ "features",
284
+ "isHotspot",
285
+ "jogEnable",
286
+ "keyboardEnable",
287
+ "pickWhenMoving",
288
+ "pitchEnable",
289
+ "rotateEnable",
290
+ "scrollWheel",
291
+ "showBuildingBlock",
292
+ "touchZoom",
293
+ "touchZoomCenter",
294
+ "zoomEnable",
295
+ "zoomSpeed"
296
+ ];
297
+ function getContainer(container) {
298
+ if (container === void 0) return container;
299
+ if (typeof container === "string") return document.getElementById(container);
300
+ else return toValue(container);
301
+ }
302
+ patchMap();
303
+ const id = `map-gaode-${useId()}`;
304
+ const container = ref();
305
+ const containerStyles = shallowReactive({});
306
+ const map = shallowRef(null);
307
+ setMapContext(map);
308
+ async function setContainer(el) {
309
+ if (!el || el === container.value) return;
310
+ if (el.offsetWidth === 0 || el.offsetHeight === 0) await nextTick();
311
+ container.value = el;
312
+ containerStyles.cursor = container.value.style.getPropertyValue("cursor");
313
+ containerStyles.backgroundColor = container.value.style.getPropertyValue("background-color");
314
+ try {
315
+ map.value = new AMap.Map(container.value, toDefinedRaw(shallowReactiveOmit(props, "container", "immediately", "duration")));
316
+ } catch (e) {
317
+ logger.error("init map error", e);
318
+ }
319
+ }
320
+ const setEl = (el) => {
321
+ setContainer(el);
322
+ };
323
+ function resetStyle(target, property, value) {
324
+ if (value) target.value?.style.setProperty(property, value);
325
+ else target.value?.style.removeProperty(property);
326
+ }
327
+ function destroyMap() {
328
+ container.value?.classList.remove("amap-container");
329
+ resetStyle(container, "cursor", containerStyles.cursor);
330
+ resetStyle(container, "background-color", containerStyles.backgroundColor);
331
+ map.value?.clearInfoWindow();
332
+ map.value?.clearMap();
333
+ map.value?.destroy();
334
+ map.value = null;
335
+ }
336
+ watch(() => props.container, async (newVal) => {
337
+ destroyMap();
338
+ await setContainer(getContainer(newVal));
339
+ }, {
340
+ immediate: true,
341
+ flush: "post"
342
+ });
343
+ mapSetOptions.forEach(([key, method]) => {
344
+ watch(() => props[key], (val) => {
345
+ if (val !== void 0) map.value?.[method](key === "center" ? clone(toRaw(val)) : val, typeof props.immediately === "boolean" ? props.immediately : props.immediately?.[key], typeof props.duration === "number" ? props.duration : props.duration?.[key]);
346
+ });
347
+ });
348
+ watch(() => props.zooms, (val) => {
349
+ if (val !== void 0) map.value?.setZooms(clone(toRaw(val)));
350
+ });
351
+ watch(() => props.labelRejectMask, (val) => {
352
+ if (val !== void 0) map.value?.setLabelRejectMask(val);
353
+ });
354
+ watch(() => props.mapStyle, (val) => {
355
+ if (val !== void 0) map.value?.setMapStyle(val);
356
+ });
357
+ watch(() => props.mask, (val) => {
358
+ if (val !== void 0) map.value?.setMask(clone(toRaw(val)));
359
+ });
360
+ watch(() => props.layers, (val) => {
361
+ if (val !== void 0) map.value?.setLayers(val);
362
+ });
363
+ watch(() => props.showLabel, (val) => {
364
+ if (val !== void 0) {
365
+ map.value?.set("showLabel", val);
366
+ map.value?.setNeedUpdate(true);
367
+ }
368
+ });
369
+ mapStatusKeys.forEach((key) => {
370
+ watch(() => props[key], (val) => {
371
+ map.value?.setStatus({ [key]: val });
372
+ });
373
+ });
374
+ use_event_listeners_default(map, emits, mapEvents);
375
+ __expose({ instance: map });
376
+ onUnmounted(destroyMap);
377
+ return (_ctx, _cache) => {
378
+ return openBlock(), createElementBlock(Fragment, null, [_ctx.$props.container === void 0 ? (openBlock(), createElementBlock("div", {
379
+ key: 0,
380
+ id: typeof _ctx.$attrs.id === "string" ? _ctx.$attrs.id : id,
381
+ ref: setEl,
382
+ class: normalizeClass(_ctx.$attrs.class),
383
+ style: normalizeStyle({
384
+ width: "100%",
385
+ height: "100%",
386
+ ..._ctx.$attrs.style || {}
387
+ })
388
+ }, null, 14, _hoisted_1)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 64);
389
+ };
390
+ }
391
+ });
392
+ // src/control/control/control.ts
393
+ const controlEvents = [hide, show];
394
+ function useControlAttributes(control, props) {
395
+ watch(() => props.visible, (val) => {
396
+ if (val !== void 0) {
397
+ if (val) control.value.show();
398
+ else control.value.hide();
399
+ }
400
+ });
401
+ }
402
+ // src/control/control-bar/control-bar.vue
403
+ var control_bar_default = /* @__PURE__ */ defineComponent({
404
+ name: "AMap.ControlBar",
405
+ inheritAttrs: false,
406
+ __name: "control-bar",
407
+ props: {
408
+ map: {},
409
+ showControlButton: {
410
+ type: Boolean,
411
+ default: void 0
412
+ },
413
+ position: {},
414
+ offset: {},
415
+ visible: {
416
+ type: Boolean,
417
+ default: void 0
418
+ }
419
+ },
420
+ emits: ["hide", "show"],
421
+ setup(__props, { expose: __expose, emit: __emit }) {
422
+ const props = __props;
423
+ const emits = __emit;
424
+ const controlBarEvents = controlEvents;
425
+ const map = useMapInstance(props);
426
+ const restProps = shallowReactiveOmit(props, "map");
427
+ const controlBar = shallowRef(new AMap.ControlBar(toDefinedRaw(restProps)));
428
+ watchEffect((onCleanup) => {
429
+ map.value?.addControl(controlBar.value);
430
+ onCleanup(() => {
431
+ map.value?.removeControl(controlBar.value);
432
+ });
433
+ });
434
+ useControlAttributes(controlBar, restProps);
435
+ use_event_listeners_default(controlBar, emits, controlBarEvents);
436
+ __expose({ instance: controlBar });
437
+ return (_ctx, _cache) => {
438
+ return null;
439
+ };
440
+ }
441
+ });
442
+ // src/control/geolocation/geolocation.vue
443
+ var geolocation_default = /* @__PURE__ */ defineComponent({
444
+ name: "AMap.Geolocation",
445
+ inheritAttrs: false,
446
+ __name: "geolocation",
447
+ props: {
448
+ map: {},
449
+ GeoLocationFirst: {
450
+ type: Boolean,
451
+ default: void 0
452
+ },
453
+ borderColor: {},
454
+ borderRadius: {},
455
+ buttonSize: {},
456
+ circleOptions: {},
457
+ convert: {
458
+ type: Boolean,
459
+ default: void 0
460
+ },
461
+ enableHighAccuracy: {
462
+ type: Boolean,
463
+ default: void 0
464
+ },
465
+ extensions: {},
466
+ getCityWhenFail: {
467
+ type: Boolean,
468
+ default: void 0
469
+ },
470
+ markerOptions: {},
471
+ maximumAge: {},
472
+ needAddress: {
473
+ type: Boolean,
474
+ default: void 0
475
+ },
476
+ noGeoLocation: {
477
+ type: Boolean,
478
+ default: void 0
479
+ },
480
+ noIpLocate: {
481
+ type: Boolean,
482
+ default: void 0
483
+ },
484
+ panToLocation: {
485
+ type: Boolean,
486
+ default: void 0
487
+ },
488
+ showButton: {
489
+ type: Boolean,
490
+ default: void 0
491
+ },
492
+ showCircle: {
493
+ type: Boolean,
494
+ default: void 0
495
+ },
496
+ showMarker: {
497
+ type: Boolean,
498
+ default: void 0
499
+ },
500
+ timeout: {},
501
+ useNative: {
502
+ type: Boolean,
503
+ default: void 0
504
+ },
505
+ zoomToAccuracy: {
506
+ type: Boolean,
507
+ default: void 0
508
+ },
509
+ position: {},
510
+ offset: {},
511
+ visible: {
512
+ type: Boolean,
513
+ default: void 0
514
+ }
515
+ },
516
+ emits: [
517
+ "hide",
518
+ "show",
519
+ "complete",
520
+ "error"
521
+ ],
522
+ setup(__props, { expose: __expose, emit: __emit }) {
523
+ const props = __props;
524
+ const emits = __emit;
525
+ const geolocationEvents = [
526
+ ...controlEvents,
527
+ complete,
528
+ error
529
+ ];
530
+ const map = useMapInstance(props);
531
+ const restProps = shallowReactiveOmit(props, "map");
532
+ const geolocation = shallowRef(new AMap.Geolocation(toDefinedRaw(restProps)));
533
+ watchEffect((onCleanup) => {
534
+ map.value?.addControl(geolocation.value);
535
+ onCleanup(() => {
536
+ map.value?.removeControl(geolocation.value);
537
+ });
538
+ });
539
+ useControlAttributes(geolocation, restProps);
540
+ use_event_listeners_default(geolocation, emits, geolocationEvents);
541
+ __expose({ instance: geolocation });
542
+ return (_ctx, _cache) => {
543
+ return null;
544
+ };
545
+ }
546
+ });
547
+ // src/control/hawk-eye/hawk-eye.vue
548
+ var hawk_eye_default = /* @__PURE__ */ defineComponent({
549
+ name: "AMap.HawkEye",
550
+ inheritAttrs: false,
551
+ __name: "hawk-eye",
552
+ props: {
553
+ map: {},
554
+ autoMove: {
555
+ type: Boolean,
556
+ default: void 0
557
+ },
558
+ showRectangle: {
559
+ type: Boolean,
560
+ default: void 0
561
+ },
562
+ showButton: {
563
+ type: Boolean,
564
+ default: void 0
565
+ },
566
+ opened: {
567
+ type: Boolean,
568
+ default: void 0
569
+ },
570
+ mapStyle: {},
571
+ layers: {},
572
+ width: {},
573
+ height: {},
574
+ offset: {},
575
+ borderStyle: {},
576
+ borderColor: {},
577
+ borderRadius: {},
578
+ borderWidth: {},
579
+ buttonSize: {},
580
+ position: {},
581
+ visible: {
582
+ type: Boolean,
583
+ default: void 0
584
+ }
585
+ },
586
+ emits: ["hide", "show"],
587
+ setup(__props, { expose: __expose, emit: __emit }) {
588
+ const props = __props;
589
+ const emits = __emit;
590
+ const hawkEyeEvents = controlEvents;
591
+ const map = useMapInstance(props);
592
+ const restProps = shallowReactiveOmit(props, "map");
593
+ const hawkEye = shallowRef(new AMap.HawkEye(toDefinedRaw(restProps)));
594
+ watchEffect((onCleanup) => {
595
+ map.value?.addControl(hawkEye.value);
596
+ onCleanup(() => {
597
+ map.value?.removeControl(hawkEye.value);
598
+ });
599
+ });
600
+ useControlAttributes(hawkEye, restProps);
601
+ use_event_listeners_default(hawkEye, emits, hawkEyeEvents);
602
+ __expose({ instance: hawkEye });
603
+ return (_ctx, _cache) => {
604
+ return null;
605
+ };
606
+ }
607
+ });
608
+ // src/control/map-type/map-type.vue
609
+ var map_type_default = /* @__PURE__ */ defineComponent({
610
+ name: "AMap.MapType",
611
+ inheritAttrs: false,
612
+ __name: "map-type",
613
+ props: {
614
+ map: {},
615
+ defaultType: {},
616
+ showTraffic: {
617
+ type: Boolean,
618
+ default: void 0
619
+ },
620
+ showRoad: {
621
+ type: Boolean,
622
+ default: void 0
623
+ },
624
+ visible: {
625
+ type: Boolean,
626
+ default: void 0
627
+ },
628
+ position: {}
629
+ },
630
+ emits: ["hide", "show"],
631
+ setup(__props, { expose: __expose, emit: __emit }) {
632
+ const props = __props;
633
+ const emits = __emit;
634
+ const mapTypeEvents = controlEvents;
635
+ const map = useMapInstance(props);
636
+ const restProps = shallowReactiveOmit(props, "map");
637
+ const mapType = shallowRef(new AMap.MapType(toDefinedRaw(restProps)));
638
+ watchEffect((onCleanup) => {
639
+ map.value?.addControl(mapType.value);
640
+ onCleanup(() => {
641
+ mapType.value._config.layerInfos.forEach((layerInfo) => {
642
+ layerInfo.layer.setMap(null);
643
+ layerInfo.layer.destroy();
644
+ });
645
+ map.value?.removeControl(mapType.value);
646
+ });
647
+ });
648
+ useControlAttributes(mapType, restProps);
649
+ use_event_listeners_default(mapType, emits, mapTypeEvents);
650
+ __expose({ instance: mapType });
651
+ return (_ctx, _cache) => {
652
+ return null;
653
+ };
654
+ }
655
+ });
656
+ // src/control/scale/scale.vue
657
+ var scale_default = /* @__PURE__ */ defineComponent({
658
+ name: "AMap.Scale",
659
+ inheritAttrs: false,
660
+ __name: "scale",
661
+ props: {
662
+ map: {},
663
+ position: {},
664
+ offset: {},
665
+ visible: {
666
+ type: Boolean,
667
+ default: void 0
668
+ }
669
+ },
670
+ emits: ["hide", "show"],
671
+ setup(__props, { expose: __expose, emit: __emit }) {
672
+ const props = __props;
673
+ const emits = __emit;
674
+ const scaleEvents = controlEvents;
675
+ const map = useMapInstance(props);
676
+ const restProps = shallowReactiveOmit(props, "map");
677
+ const scale = shallowRef(new AMap.Scale(toDefinedRaw(restProps)));
678
+ watchEffect((onCleanup) => {
679
+ map.value?.addControl(scale.value);
680
+ onCleanup(() => {
681
+ map.value?.removeControl(scale.value);
682
+ });
683
+ });
684
+ useControlAttributes(scale, restProps);
685
+ use_event_listeners_default(scale, emits, scaleEvents);
686
+ __expose({ instance: scale });
687
+ return (_ctx, _cache) => {
688
+ return null;
689
+ };
690
+ }
691
+ });
692
+ // src/control/tool-bar/tool-bar.vue
693
+ var tool_bar_default = /* @__PURE__ */ defineComponent({
694
+ name: "AMap.ToolBar",
695
+ inheritAttrs: false,
696
+ __name: "tool-bar",
697
+ props: {
698
+ map: {},
699
+ position: {},
700
+ offset: {},
701
+ visible: {
702
+ type: Boolean,
703
+ default: void 0
704
+ }
705
+ },
706
+ emits: ["hide", "show"],
707
+ setup(__props, { expose: __expose, emit: __emit }) {
708
+ const props = __props;
709
+ const emits = __emit;
710
+ const toolBarEvents = controlEvents;
711
+ const map = useMapInstance(props);
712
+ const restProps = shallowReactiveOmit(props, "map");
713
+ const toolBar = shallowRef(new AMap.ToolBar(toDefinedRaw(restProps)));
714
+ watchEffect((onCleanup) => {
715
+ map.value?.addControl(toolBar.value);
716
+ onCleanup(() => {
717
+ map.value?.removeControl(toolBar.value);
718
+ });
719
+ });
720
+ useControlAttributes(toolBar, restProps);
721
+ use_event_listeners_default(toolBar, emits, toolBarEvents);
722
+ __expose({ instance: toolBar });
723
+ return (_ctx, _cache) => {
724
+ return null;
725
+ };
726
+ }
727
+ });
728
+ // src/layer/layer/layer.ts
729
+ const layerEvents = [complete];
730
+ function useLayerAttributes(layer, props) {
731
+ watch(() => props.opacity, (val) => {
732
+ if (val !== void 0) layer.value.setOpacity(val);
733
+ });
734
+ watch(() => props.zooms, (val) => {
735
+ if (val !== void 0) layer.value.setZooms(val);
736
+ });
737
+ watch(() => props.zIndex, (val) => {
738
+ if (val !== void 0) layer.value.setzIndex(val);
739
+ });
740
+ watch(() => props.visible, (val) => {
741
+ if (val !== void 0) {
742
+ if (val) layer.value.show();
743
+ else layer.value.hide();
744
+ }
745
+ });
746
+ }
747
+ // src/layer/buildings/buildings.vue
748
+ var buildings_default = /* @__PURE__ */ defineComponent({
749
+ name: "AMap.Buildings",
750
+ inheritAttrs: false,
751
+ __name: "buildings",
752
+ props: {
753
+ style: {},
754
+ heightFactor: {},
755
+ roofColor: {},
756
+ wallColor: {},
757
+ cacheSize: {},
758
+ ce: {
759
+ type: Boolean,
760
+ default: void 0
761
+ },
762
+ depthTest: {
763
+ type: Boolean,
764
+ default: void 0
765
+ },
766
+ map: {},
767
+ opacity: {},
768
+ rejectMapMask: {
769
+ type: Boolean,
770
+ default: void 0
771
+ },
772
+ visible: {
773
+ type: Boolean,
774
+ default: void 0
775
+ },
776
+ zIndex: {},
777
+ zooms: {}
778
+ },
779
+ emits: ["complete"],
780
+ setup(__props, { expose: __expose, emit: __emit }) {
781
+ const props = __props;
782
+ const emits = __emit;
783
+ const buildingsEvents = layerEvents;
784
+ const map = useMapInstance(props);
785
+ const restProps = shallowReactiveOmit(props, "map");
786
+ const buildings = shallowRef(new AMap.Buildings(toDefinedRaw(restProps)));
787
+ watchEffect((onCleanup) => {
788
+ if (!map.value) return;
789
+ buildings.value.setMap(map.value);
790
+ onCleanup(() => {
791
+ buildings.value.setMap(null);
792
+ });
793
+ });
794
+ onUnmounted(() => buildings.value.destroy());
795
+ useLayerAttributes(buildings, props);
796
+ watch(() => props.style, (val) => {
797
+ if (val !== void 0) buildings.value.setStyle(val);
798
+ });
799
+ use_event_listeners_default(buildings, emits, buildingsEvents);
800
+ __expose({ instance: buildings });
801
+ return (_ctx, _cache) => {
802
+ return null;
803
+ };
804
+ }
805
+ });
806
+ // src/layer/canvas-layer/canvas-layer.vue
807
+ var canvas_layer_default = /* @__PURE__ */ defineComponent({
808
+ name: "AMap.CanvasLayer",
809
+ inheritAttrs: false,
810
+ __name: "canvas-layer",
811
+ props: {
812
+ bounds: {},
813
+ canvas: {},
814
+ tileUrl: {},
815
+ url: {},
816
+ cacheSize: {},
817
+ ce: {
818
+ type: Boolean,
819
+ default: void 0
820
+ },
821
+ depthTest: {
822
+ type: Boolean,
823
+ default: void 0
824
+ },
825
+ map: {},
826
+ opacity: {},
827
+ rejectMapMask: {
828
+ type: Boolean,
829
+ default: void 0
830
+ },
831
+ visible: {
832
+ type: Boolean,
833
+ default: void 0
834
+ },
835
+ zIndex: {},
836
+ zooms: {}
837
+ },
838
+ emits: ["complete"],
839
+ setup(__props, { expose: __expose, emit: __emit }) {
840
+ const props = __props;
841
+ const emits = __emit;
842
+ const canvasLayerEvents = layerEvents;
843
+ const map = useMapInstance(props);
844
+ const restProps = shallowReactiveOmit(props, "map");
845
+ const canvasLayer = shallowRef(new AMap.CanvasLayer(toDefinedRaw(restProps)));
846
+ watchEffect((onCleanup) => {
847
+ if (!map.value) return;
848
+ canvasLayer.value.setMap(map.value);
849
+ onCleanup(() => {
850
+ canvasLayer.value.setMap(null);
851
+ });
852
+ });
853
+ onUnmounted(() => canvasLayer.value.destroy());
854
+ useLayerAttributes(canvasLayer, props);
855
+ watchEffect(() => {
856
+ if (!map.value) return;
857
+ canvasLayer.value.setBounds(props.bounds);
858
+ });
859
+ watch(() => props.canvas, (val) => {
860
+ if (val !== void 0) canvasLayer.value.setCanvas(val);
861
+ });
862
+ use_event_listeners_default(canvasLayer, emits, canvasLayerEvents);
863
+ __expose({ instance: canvasLayer });
864
+ return (_ctx, _cache) => {
865
+ return null;
866
+ };
867
+ }
868
+ });
869
+ // src/layer/custom-layer/custom-layer.vue
870
+ var custom_layer_default = /* @__PURE__ */ defineComponent({
871
+ name: "AMap.CustomLayer",
872
+ inheritAttrs: false,
873
+ __name: "custom-layer",
874
+ props: {
875
+ element: {},
876
+ render: {},
877
+ alwaysRender: {
878
+ type: Boolean,
879
+ default: void 0
880
+ },
881
+ cacheSize: {},
882
+ ce: {
883
+ type: Boolean,
884
+ default: void 0
885
+ },
886
+ depthTest: {
887
+ type: Boolean,
888
+ default: void 0
889
+ },
890
+ map: {},
891
+ opacity: {},
892
+ rejectMapMask: {
893
+ type: Boolean,
894
+ default: void 0
895
+ },
896
+ visible: {
897
+ type: Boolean,
898
+ default: void 0
899
+ },
900
+ zIndex: {},
901
+ zooms: {}
902
+ },
903
+ emits: ["complete"],
904
+ setup(__props, { expose: __expose, emit: __emit }) {
905
+ const props = __props;
906
+ const emits = __emit;
907
+ const customLayerEvents = layerEvents;
908
+ const map = useMapInstance(props);
909
+ const restProps = shallowReactiveOmit(props, "map", "element");
910
+ const customLayer = shallowRef(new AMap.CustomLayer(props.element, toDefinedRaw(restProps)));
911
+ watchEffect((onCleanup) => {
912
+ if (!map.value) return;
913
+ customLayer.value.setMap(map.value);
914
+ onCleanup(() => {
915
+ customLayer.value.setMap(null);
916
+ });
917
+ });
918
+ onUnmounted(() => customLayer.value.destroy());
919
+ useLayerAttributes(customLayer, props);
920
+ watch(() => props.render, (val) => {
921
+ customLayer.value.render = val || customLayer.value.render;
922
+ });
923
+ watch(() => props.visible, (val) => {
924
+ if (val !== void 0) {
925
+ if (val) {
926
+ customLayer.value.canvas.style.visibility = "visible";
927
+ customLayer.value.canvas.style.display = "block";
928
+ } else {
929
+ customLayer.value.canvas.style.visibility = "hidden";
930
+ customLayer.value.canvas.style.display = "none";
931
+ }
932
+ }
933
+ });
934
+ use_event_listeners_default(customLayer, emits, customLayerEvents);
935
+ __expose({ instance: customLayer });
936
+ return (_ctx, _cache) => {
937
+ return null;
938
+ };
939
+ }
940
+ });
941
+ // src/layer/district-layer/district-layer/use-attributes.ts
942
+ function useDistrictLayerAttributes(districtLayer, props) {
943
+ useLayerAttributes(districtLayer, props);
944
+ watch(() => props.adcode, (val) => {
945
+ if (val !== void 0) districtLayer.value.setAdcode(val);
946
+ });
947
+ watch(() => props.SOC, (val) => {
948
+ if (val !== void 0) districtLayer.value.setSOC(val);
949
+ });
950
+ watch(() => props.styles, (val) => {
951
+ if (val !== void 0) districtLayer.value.setStyles(toRaw(val));
952
+ });
953
+ }
954
+ // src/layer/district-layer/district-layer/district-layer.vue
955
+ var district_layer_default = /* @__PURE__ */ defineComponent({
956
+ name: "AMap.DistrictLayer",
957
+ inheritAttrs: false,
958
+ __name: "district-layer",
959
+ props: {
960
+ adcode: {},
961
+ depth: {},
962
+ SOC: {},
963
+ styles: {},
964
+ zIndex: {},
965
+ getTileUrl: {},
966
+ name: {},
967
+ id: {},
968
+ dataZooms: {},
969
+ detectRetina: {
970
+ type: Boolean,
971
+ default: void 0
972
+ },
973
+ projection: {},
974
+ tileUrl: {},
975
+ tileSize: {},
976
+ cacheSize: {},
977
+ ce: {
978
+ type: Boolean,
979
+ default: void 0
980
+ },
981
+ depthTest: {
982
+ type: Boolean,
983
+ default: void 0
984
+ },
985
+ map: {},
986
+ opacity: {},
987
+ rejectMapMask: {
988
+ type: Boolean,
989
+ default: void 0
990
+ },
991
+ visible: {
992
+ type: Boolean,
993
+ default: void 0
994
+ },
995
+ zooms: {}
996
+ },
997
+ emits: ["complete"],
998
+ setup(__props, { expose: __expose, emit: __emit }) {
999
+ const props = __props;
1000
+ const emits = __emit;
1001
+ const districtLayerEvents = layerEvents;
1002
+ const map = useMapInstance(props);
1003
+ const restProps = shallowReactiveOmit(props, "map");
1004
+ const districtLayer = shallowRef(new AMap.DistrictLayer(toDefinedRaw(restProps)));
1005
+ watchEffect((onCleanup) => {
1006
+ if (!map.value) return;
1007
+ districtLayer.value.setMap(map.value);
1008
+ onCleanup(() => {
1009
+ districtLayer.value.setMap(null);
1010
+ });
1011
+ });
1012
+ onUnmounted(() => districtLayer.value.destroy());
1013
+ useDistrictLayerAttributes(districtLayer, props);
1014
+ use_event_listeners_default(districtLayer, emits, districtLayerEvents);
1015
+ __expose({ instance: districtLayer });
1016
+ return (_ctx, _cache) => {
1017
+ return null;
1018
+ };
1019
+ }
1020
+ });
1021
+ // src/layer/district-layer/country/country.vue
1022
+ var country_default = /* @__PURE__ */ defineComponent({
1023
+ name: "AMap.DistrictLayer.Country",
1024
+ inheritAttrs: false,
1025
+ __name: "country",
1026
+ props: {
1027
+ depth: {},
1028
+ SOC: {},
1029
+ zIndex: {},
1030
+ adcode: {},
1031
+ styles: {},
1032
+ getTileUrl: {},
1033
+ name: {},
1034
+ id: {},
1035
+ dataZooms: {},
1036
+ detectRetina: {
1037
+ type: Boolean,
1038
+ default: void 0
1039
+ },
1040
+ projection: {},
1041
+ tileUrl: {},
1042
+ tileSize: {},
1043
+ cacheSize: {},
1044
+ ce: {
1045
+ type: Boolean,
1046
+ default: void 0
1047
+ },
1048
+ depthTest: {
1049
+ type: Boolean,
1050
+ default: void 0
1051
+ },
1052
+ map: {},
1053
+ opacity: {},
1054
+ rejectMapMask: {
1055
+ type: Boolean,
1056
+ default: void 0
1057
+ },
1058
+ visible: {
1059
+ type: Boolean,
1060
+ default: void 0
1061
+ },
1062
+ zooms: {}
1063
+ },
1064
+ emits: ["complete"],
1065
+ setup(__props, { expose: __expose, emit: __emit }) {
1066
+ const props = __props;
1067
+ const emits = __emit;
1068
+ const countryEvents = layerEvents;
1069
+ const map = useMapInstance(props);
1070
+ const restProps = shallowReactiveOmit(props, "map");
1071
+ const country = shallowRef(new AMap.DistrictLayer.Country(toDefinedRaw(restProps)));
1072
+ watchEffect((onCleanup) => {
1073
+ if (!map.value) return;
1074
+ country.value.setMap(map.value);
1075
+ onCleanup(() => {
1076
+ country.value.setMap(null);
1077
+ });
1078
+ });
1079
+ onUnmounted(() => country.value.destroy());
1080
+ useDistrictLayerAttributes(country, props);
1081
+ use_event_listeners_default(country, emits, countryEvents);
1082
+ __expose({ instance: country });
1083
+ return (_ctx, _cache) => {
1084
+ return null;
1085
+ };
1086
+ }
1087
+ });
1088
+ // src/layer/district-layer/province/province.vue
1089
+ var province_default = /* @__PURE__ */ defineComponent({
1090
+ name: "AMap.DistrictLayer.Province",
1091
+ inheritAttrs: false,
1092
+ __name: "province",
1093
+ props: {
1094
+ depth: {},
1095
+ SOC: {},
1096
+ zIndex: {},
1097
+ adcode: {},
1098
+ styles: {},
1099
+ getTileUrl: {},
1100
+ name: {},
1101
+ id: {},
1102
+ dataZooms: {},
1103
+ detectRetina: {
1104
+ type: Boolean,
1105
+ default: void 0
1106
+ },
1107
+ projection: {},
1108
+ tileUrl: {},
1109
+ tileSize: {},
1110
+ cacheSize: {},
1111
+ ce: {
1112
+ type: Boolean,
1113
+ default: void 0
1114
+ },
1115
+ depthTest: {
1116
+ type: Boolean,
1117
+ default: void 0
1118
+ },
1119
+ map: {},
1120
+ opacity: {},
1121
+ rejectMapMask: {
1122
+ type: Boolean,
1123
+ default: void 0
1124
+ },
1125
+ visible: {
1126
+ type: Boolean,
1127
+ default: void 0
1128
+ },
1129
+ zooms: {}
1130
+ },
1131
+ emits: ["complete"],
1132
+ setup(__props, { expose: __expose, emit: __emit }) {
1133
+ const props = __props;
1134
+ const emits = __emit;
1135
+ const provinceEvents = layerEvents;
1136
+ const map = useMapInstance(props);
1137
+ const restProps = shallowReactiveOmit(props, "map");
1138
+ const province = shallowRef(new AMap.DistrictLayer.Province(toDefinedRaw(restProps)));
1139
+ watchEffect((onCleanup) => {
1140
+ if (!map.value) return;
1141
+ province.value.setMap(map.value);
1142
+ onCleanup(() => {
1143
+ province.value.setMap(null);
1144
+ });
1145
+ });
1146
+ onUnmounted(() => province.value.destroy());
1147
+ useDistrictLayerAttributes(province, props);
1148
+ use_event_listeners_default(province, emits, provinceEvents);
1149
+ __expose({ instance: province });
1150
+ return (_ctx, _cache) => {
1151
+ return null;
1152
+ };
1153
+ }
1154
+ });
1155
+ // src/layer/district-layer/world/world.vue
1156
+ var world_default = /* @__PURE__ */ defineComponent({
1157
+ name: "AMap.DistrictLayer.World",
1158
+ inheritAttrs: false,
1159
+ __name: "world",
1160
+ props: {
1161
+ SOC: {},
1162
+ zIndex: {},
1163
+ adcode: {},
1164
+ depth: {},
1165
+ styles: {},
1166
+ getTileUrl: {},
1167
+ name: {},
1168
+ id: {},
1169
+ dataZooms: {},
1170
+ detectRetina: {
1171
+ type: Boolean,
1172
+ default: void 0
1173
+ },
1174
+ projection: {},
1175
+ tileUrl: {},
1176
+ tileSize: {},
1177
+ cacheSize: {},
1178
+ ce: {
1179
+ type: Boolean,
1180
+ default: void 0
1181
+ },
1182
+ depthTest: {
1183
+ type: Boolean,
1184
+ default: void 0
1185
+ },
1186
+ map: {},
1187
+ opacity: {},
1188
+ rejectMapMask: {
1189
+ type: Boolean,
1190
+ default: void 0
1191
+ },
1192
+ visible: {
1193
+ type: Boolean,
1194
+ default: void 0
1195
+ },
1196
+ zooms: {}
1197
+ },
1198
+ emits: ["complete"],
1199
+ setup(__props, { expose: __expose, emit: __emit }) {
1200
+ const props = __props;
1201
+ const emits = __emit;
1202
+ const worldEvents = layerEvents;
1203
+ const map = useMapInstance(props);
1204
+ const restProps = shallowReactiveOmit(props, "map");
1205
+ const world = shallowRef(new AMap.DistrictLayer.World(toDefinedRaw(restProps)));
1206
+ watchEffect((onCleanup) => {
1207
+ if (!map.value) return;
1208
+ world.value.setMap(map.value);
1209
+ onCleanup(() => {
1210
+ world.value.setMap(null);
1211
+ });
1212
+ });
1213
+ onUnmounted(() => world.value.destroy());
1214
+ useDistrictLayerAttributes(world, props);
1215
+ use_event_listeners_default(world, emits, worldEvents);
1216
+ __expose({ instance: world });
1217
+ return (_ctx, _cache) => {
1218
+ return null;
1219
+ };
1220
+ }
1221
+ });
1222
+ // src/layer/gl-custom-layer/gl-custom-layer.vue
1223
+ var gl_custom_layer_default = /* @__PURE__ */ defineComponent({
1224
+ name: "AMap.GLCustomLayer",
1225
+ inheritAttrs: false,
1226
+ __name: "gl-custom-layer",
1227
+ props: {
1228
+ init: {},
1229
+ render: {},
1230
+ cacheSize: {},
1231
+ ce: {
1232
+ type: Boolean,
1233
+ default: void 0
1234
+ },
1235
+ depthTest: {
1236
+ type: Boolean,
1237
+ default: void 0
1238
+ },
1239
+ map: {},
1240
+ opacity: {},
1241
+ rejectMapMask: {
1242
+ type: Boolean,
1243
+ default: void 0
1244
+ },
1245
+ visible: {
1246
+ type: Boolean,
1247
+ default: void 0
1248
+ },
1249
+ zIndex: {},
1250
+ zooms: {}
1251
+ },
1252
+ emits: ["complete"],
1253
+ setup(__props, { expose: __expose, emit: __emit }) {
1254
+ const props = __props;
1255
+ const emits = __emit;
1256
+ const glCustomLayerEvents = layerEvents;
1257
+ const map = useMapInstance(props);
1258
+ const restProps = shallowReactiveOmit(props, "map");
1259
+ const glCustomLayer = shallowRef(new AMap.GLCustomLayer(toDefinedRaw(restProps)));
1260
+ watchEffect((onCleanup) => {
1261
+ if (!map.value) return;
1262
+ glCustomLayer.value.setMap(map.value);
1263
+ onCleanup(() => {
1264
+ glCustomLayer.value.setMap(null);
1265
+ });
1266
+ });
1267
+ onUnmounted(() => glCustomLayer.value.destroy());
1268
+ useLayerAttributes(glCustomLayer, props);
1269
+ watch(() => props.init, (val) => {
1270
+ glCustomLayer.value.init = val || glCustomLayer.value.init;
1271
+ });
1272
+ watch(() => props.render, (val) => {
1273
+ glCustomLayer.value.render = val || glCustomLayer.value.render;
1274
+ });
1275
+ use_event_listeners_default(glCustomLayer, emits, glCustomLayerEvents);
1276
+ __expose({ instance: glCustomLayer });
1277
+ return (_ctx, _cache) => {
1278
+ return renderSlot(_ctx.$slots, "default");
1279
+ };
1280
+ }
1281
+ });
1282
+ // src/layer/heat-map/heat-map.vue
1283
+ var heat_map_default = /* @__PURE__ */ defineComponent({
1284
+ name: "AMap.HeatMap",
1285
+ inheritAttrs: false,
1286
+ __name: "heat-map",
1287
+ props: {
1288
+ map: {},
1289
+ dataset: {},
1290
+ blur: {},
1291
+ gradient: {},
1292
+ opacity: {},
1293
+ radius: {},
1294
+ radiusUnit: {},
1295
+ rejectMapMask: {
1296
+ type: Boolean,
1297
+ default: void 0
1298
+ },
1299
+ renderOnZooming: {
1300
+ type: Boolean,
1301
+ default: void 0
1302
+ },
1303
+ visible: {
1304
+ type: Boolean,
1305
+ default: void 0
1306
+ },
1307
+ zIndex: {},
1308
+ zooms: {},
1309
+ threeD: {}
1310
+ },
1311
+ setup(__props, { expose: __expose }) {
1312
+ const props = __props;
1313
+ const map = useMapInstance(props);
1314
+ const restProps = shallowReactiveOmit(props, "map");
1315
+ const { threeD, ...options } = toDefinedRaw(restProps);
1316
+ const heatMap = shallowRef(new AMap.HeatMap(null, {
1317
+ ...options,
1318
+ "3d": threeD
1319
+ }));
1320
+ watchEffect((onCleanup) => {
1321
+ if (!map.value) return;
1322
+ heatMap.value.setMap(map.value);
1323
+ onCleanup(() => {
1324
+ heatMap.value._renderLayer._render.setMap(null);
1325
+ heatMap.value._renderLayer._render.render.destroy();
1326
+ heatMap.value.setMap(null);
1327
+ });
1328
+ });
1329
+ watch(() => props.visible, (val) => {
1330
+ if (val !== void 0) {
1331
+ if (val) heatMap.value.show();
1332
+ else heatMap.value.hide();
1333
+ }
1334
+ }, { immediate: true });
1335
+ watch(() => props.zIndex, (val) => {
1336
+ if (val !== void 0) heatMap.value.setzIndex(val);
1337
+ });
1338
+ watch(() => props.dataset, (val) => {
1339
+ if (val !== void 0) heatMap.value.setDataSet(clone(toRaw(val), true));
1340
+ }, { immediate: true });
1341
+ watch(shallowReactiveOmit(restProps, [
1342
+ "visible",
1343
+ "zIndex",
1344
+ "dataset"
1345
+ ]), (val) => {
1346
+ const { threeD, ...options } = toDefinedRaw(val);
1347
+ heatMap.value.setOptions({
1348
+ ...options,
1349
+ "3d": threeD
1350
+ });
1351
+ });
1352
+ __expose({ instance: heatMap });
1353
+ return (_ctx, _cache) => {
1354
+ return null;
1355
+ };
1356
+ }
1357
+ });
1358
+ // src/layer/image-layer/image-layer.vue
1359
+ var image_layer_default = /* @__PURE__ */ defineComponent({
1360
+ name: "AMap.ImageLayer",
1361
+ inheritAttrs: false,
1362
+ __name: "image-layer",
1363
+ props: {
1364
+ bounds: {},
1365
+ canvas: {},
1366
+ tileUrl: {},
1367
+ url: {},
1368
+ cacheSize: {},
1369
+ ce: {
1370
+ type: Boolean,
1371
+ default: void 0
1372
+ },
1373
+ depthTest: {
1374
+ type: Boolean,
1375
+ default: void 0
1376
+ },
1377
+ map: {},
1378
+ opacity: {},
1379
+ rejectMapMask: {
1380
+ type: Boolean,
1381
+ default: void 0
1382
+ },
1383
+ visible: {
1384
+ type: Boolean,
1385
+ default: void 0
1386
+ },
1387
+ zIndex: {},
1388
+ zooms: {}
1389
+ },
1390
+ emits: ["complete"],
1391
+ setup(__props, { expose: __expose, emit: __emit }) {
1392
+ const props = __props;
1393
+ const emits = __emit;
1394
+ const imageLayerEvents = layerEvents;
1395
+ const map = useMapInstance(props);
1396
+ const restProps = shallowReactiveOmit(props, "map");
1397
+ const imageLayer = shallowRef(new AMap.ImageLayer(toDefinedRaw(restProps)));
1398
+ watchEffect((onCleanup) => {
1399
+ if (!map.value) return;
1400
+ imageLayer.value.setMap(map.value);
1401
+ onCleanup(() => {
1402
+ imageLayer.value.setMap(null);
1403
+ });
1404
+ });
1405
+ onUnmounted(() => imageLayer.value.destroy());
1406
+ useLayerAttributes(imageLayer, props);
1407
+ watchEffect(() => {
1408
+ if (!map.value) return;
1409
+ imageLayer.value.setBounds(props.bounds);
1410
+ });
1411
+ watchEffect(() => {
1412
+ if (!map.value) return;
1413
+ imageLayer.value.setImageUrl(props.url ?? props.tileUrl);
1414
+ });
1415
+ use_event_listeners_default(imageLayer, emits, imageLayerEvents);
1416
+ __expose({ instance: imageLayer });
1417
+ return (_ctx, _cache) => {
1418
+ return null;
1419
+ };
1420
+ }
1421
+ });
1422
+ // src/layer/indoor-map/indoor-map.vue
1423
+ var indoor_map_default = /* @__PURE__ */ defineComponent({
1424
+ name: "AMap.IndoorMap",
1425
+ inheritAttrs: false,
1426
+ __name: "indoor-map",
1427
+ props: {
1428
+ POIId: {},
1429
+ floor: {},
1430
+ cursor: {},
1431
+ hideFloorBar: {
1432
+ type: Boolean,
1433
+ default: void 0
1434
+ },
1435
+ cacheSize: {},
1436
+ ce: {
1437
+ type: Boolean,
1438
+ default: void 0
1439
+ },
1440
+ depthTest: {
1441
+ type: Boolean,
1442
+ default: void 0
1443
+ },
1444
+ map: {},
1445
+ opacity: {},
1446
+ rejectMapMask: {
1447
+ type: Boolean,
1448
+ default: void 0
1449
+ },
1450
+ visible: {
1451
+ type: Boolean,
1452
+ default: void 0
1453
+ },
1454
+ zIndex: {},
1455
+ zooms: {}
1456
+ },
1457
+ emits: ["complete", "click"],
1458
+ setup(__props, { expose: __expose, emit: __emit }) {
1459
+ const props = __props;
1460
+ const emits = __emit;
1461
+ const indoorMapEvents = [...layerEvents, click];
1462
+ const map = useMapInstance(props);
1463
+ const restProps = shallowReactiveOmit(props, "map", "POIId", "floor");
1464
+ const indoorMap = shallowRef(map.value?.indoorMap ?? new AMap.IndoorMap(toDefinedRaw(restProps)));
1465
+ watchEffect((onCleanup) => {
1466
+ if (!map.value) return;
1467
+ if (map.value.indoorMap) return;
1468
+ const { animateEnable } = map.value.getStatus();
1469
+ const before = [...map.value.getEvents()?.moveend ?? []];
1470
+ indoorMap.value.setMap(map.value);
1471
+ const moveEndFns = [...map.value.getEvents()?.moveend ?? []].filter((a) => !before?.some((b) => b.fn === a.fn && b.context === a.context));
1472
+ onCleanup(() => {
1473
+ moveEndFns?.forEach(({ fn, context }) => {
1474
+ map.value?.off("moveend", fn, context);
1475
+ });
1476
+ if (indoorMap.value.e$) map.value?.removeControl(indoorMap.value.e$);
1477
+ indoorMap.value.VR.labelsLayer?.setMap(null);
1478
+ map.value?.removeLayer(indoorMap.value);
1479
+ map.value?.setStatus({ animateEnable });
1480
+ delete map.value?.im().Yh.indoor;
1481
+ });
1482
+ });
1483
+ watchEffect(() => {
1484
+ if (map.value && props.POIId) {
1485
+ indoorMap.value.showIndoorMap(props.POIId, props.floor);
1486
+ indoorMap.value.getSource()?.JR?.(props.POIId, props.floor);
1487
+ }
1488
+ });
1489
+ onUnmounted(() => {
1490
+ if (!map.value || map.value.indoorMap) return;
1491
+ indoorMap.value.VR.labelsLayer?.destroy();
1492
+ indoorMap.value?.destroy();
1493
+ });
1494
+ useLayerAttributes(indoorMap, props);
1495
+ watch(() => props.hideFloorBar, (val) => {
1496
+ if (val !== void 0) {
1497
+ if (val) indoorMap.value.hideFloorBar();
1498
+ else indoorMap.value.showFloorBar();
1499
+ }
1500
+ });
1501
+ use_event_listeners_default(indoorMap, emits, indoorMapEvents);
1502
+ __expose({ instance: indoorMap });
1503
+ return (_ctx, _cache) => {
1504
+ return null;
1505
+ };
1506
+ }
1507
+ });
1508
+ // src/layer/labels-layer/context.ts
1509
+ const AMap_Symbol_LabelsLayer = Symbol("LabelsLayer");
1510
+ /**
1511
+ * 设置LabelsLayer实例Context
1512
+ * @param {ShallowRef<AMap.LabelsLayer>} labelsLayer - LabelsLayer实例ref
1513
+ */
1514
+ function setLabelsLayerContext(labelsLayer) {
1515
+ provide(AMap_Symbol_LabelsLayer, labelsLayer);
1516
+ }
1517
+ /**
1518
+ * 获取LabelsLayer实例
1519
+ * @returns {ShallowRef<AMap.LabelsLayer>} - LabelsLayer实例ref
1520
+ */
1521
+ function useLabelsLayer() {
1522
+ const context = inject(AMap_Symbol_LabelsLayer);
1523
+ if (!context) throw lostContextError("`AMap.LabelsLayer`");
1524
+ return context;
1525
+ }
1526
+ /**
1527
+ * 获取LabelsLayer实例
1528
+ * @returns {ShallowRef<AMap.LabelsLayer> | undefined} - LabelsLayer实例ref或 `undefined`
1529
+ */
1530
+ function useLabelsLayerInstance() {
1531
+ return inject(AMap_Symbol_LabelsLayer, void 0);
1532
+ }
1533
+ // src/layer/labels-layer/labels-layer.vue
1534
+ var labels_layer_default = /* @__PURE__ */ defineComponent({
1535
+ name: "AMap.LabelsLayer",
1536
+ inheritAttrs: false,
1537
+ __name: "labels-layer",
1538
+ props: {
1539
+ labelMarkers: {},
1540
+ allowCollision: {
1541
+ type: Boolean,
1542
+ default: void 0
1543
+ },
1544
+ animation: {
1545
+ type: Boolean,
1546
+ default: void 0
1547
+ },
1548
+ collision: {
1549
+ type: Boolean,
1550
+ default: void 0
1551
+ },
1552
+ createTile: {},
1553
+ cacheSize: {},
1554
+ ce: {
1555
+ type: Boolean,
1556
+ default: void 0
1557
+ },
1558
+ depthTest: {
1559
+ type: Boolean,
1560
+ default: void 0
1561
+ },
1562
+ map: {},
1563
+ opacity: {},
1564
+ rejectMapMask: {
1565
+ type: Boolean,
1566
+ default: void 0
1567
+ },
1568
+ visible: {
1569
+ type: Boolean,
1570
+ default: void 0
1571
+ },
1572
+ zIndex: {},
1573
+ zooms: {}
1574
+ },
1575
+ emits: ["complete"],
1576
+ setup(__props, { expose: __expose, emit: __emit }) {
1577
+ const props = __props;
1578
+ const emits = __emit;
1579
+ const labelsLayerEvents = layerEvents;
1580
+ const map = useMapInstance(props);
1581
+ const restProps = shallowReactiveOmit(props, "map", "labelMarkers");
1582
+ const labelsLayer = shallowRef(new AMap.LabelsLayer(toDefinedRaw(restProps)));
1583
+ watchEffect((onCleanup) => {
1584
+ if (!map.value) return;
1585
+ labelsLayer.value.setMap(map.value);
1586
+ onCleanup(() => {
1587
+ labelsLayer.value.setMap(null);
1588
+ });
1589
+ });
1590
+ watchEffect((onCleanup) => {
1591
+ if (props.labelMarkers !== void 0) labelsLayer.value.add(props.labelMarkers);
1592
+ onCleanup(() => {
1593
+ labelsLayer.value.remove(labelsLayer.value.getAllOverlays());
1594
+ });
1595
+ });
1596
+ onUnmounted(() => labelsLayer.value.destroy());
1597
+ useLayerAttributes(labelsLayer, props);
1598
+ watch(() => props.allowCollision, (val) => {
1599
+ if (val !== void 0) labelsLayer.value.setAllowCollision(val);
1600
+ });
1601
+ watch(() => props.collision, (val) => {
1602
+ if (val !== void 0) labelsLayer.value.setCollision(val);
1603
+ });
1604
+ use_event_listeners_default(labelsLayer, emits, labelsLayerEvents);
1605
+ setLabelsLayerContext(labelsLayer);
1606
+ __expose({ instance: labelsLayer });
1607
+ return (_ctx, _cache) => {
1608
+ return __props.labelMarkers === void 0 ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : createCommentVNode("v-if", true);
1609
+ };
1610
+ }
1611
+ });
1612
+ // src/layer/layer-group/layer-group.vue
1613
+ var layer_group_default = /* @__PURE__ */ defineComponent({
1614
+ name: "AMap.LayerGroup",
1615
+ inheritAttrs: false,
1616
+ __name: "layer-group",
1617
+ props: {
1618
+ map: {},
1619
+ visible: {
1620
+ type: Boolean,
1621
+ default: void 0
1622
+ },
1623
+ layers: { default: () => [] }
1624
+ },
1625
+ emits: ["complete"],
1626
+ setup(__props, { expose: __expose, emit: __emit }) {
1627
+ const props = __props;
1628
+ const emits = __emit;
1629
+ const layerGroupEvents = layerEvents;
1630
+ const map = useMapInstance(props);
1631
+ const layerGroup = shallowRef(new AMap.LayerGroup());
1632
+ watch(() => [...props.layers], (newLayers) => {
1633
+ const current = new Set(layerGroup.value.getLayers());
1634
+ const next = new Set(newLayers);
1635
+ const toRemove = [...current].filter((l) => !next.has(l));
1636
+ const toAdd = [...next].filter((l) => !current.has(l));
1637
+ if (toRemove.length) layerGroup.value.removeLayers(toRemove);
1638
+ if (toAdd.length) layerGroup.value.addLayers(toAdd);
1639
+ }, {
1640
+ deep: true,
1641
+ immediate: true
1642
+ });
1643
+ watchEffect((onCleanup) => {
1644
+ if (!map.value) return;
1645
+ layerGroup.value.setMap(map.value);
1646
+ onCleanup(() => {
1647
+ layerGroup.value.setMap(null);
1648
+ });
1649
+ });
1650
+ watch(() => props.visible, (val) => {
1651
+ if (val !== void 0) {
1652
+ if (val) layerGroup.value.show();
1653
+ else layerGroup.value.hide();
1654
+ }
1655
+ });
1656
+ const boundMap = /* @__PURE__ */ new Map();
1657
+ watch(() => [...props.layers], (newLayers) => {
1658
+ const nextLayers = newLayers ? [...new Set(newLayers)] : [];
1659
+ const nextSet = new Set(nextLayers);
1660
+ for (const [layer, handlerMap] of boundMap) if (!nextSet.has(layer)) {
1661
+ for (const [eventType, handler] of handlerMap) layer.off(lowercase(eventType), handler);
1662
+ boundMap.delete(layer);
1663
+ if ("destroy" in layer && typeof layer.destroy === "function") layer.destroy();
1664
+ }
1665
+ for (const layer of nextLayers) {
1666
+ if (boundMap.has(layer)) continue;
1667
+ const handlerMap = /* @__PURE__ */ new Map();
1668
+ for (const eventType of layerGroupEvents) {
1669
+ const handler = (event) => {
1670
+ emits(eventType, event);
1671
+ };
1672
+ layer.on(lowercase(eventType), handler);
1673
+ handlerMap.set(eventType, handler);
1674
+ }
1675
+ boundMap.set(layer, handlerMap);
1676
+ }
1677
+ }, {
1678
+ deep: true,
1679
+ immediate: true
1680
+ });
1681
+ __expose({ instance: layerGroup });
1682
+ function dispose() {
1683
+ for (const [layer, handlerMap] of boundMap) {
1684
+ for (const [eventType, handler] of handlerMap) layer.off(lowercase(eventType), handler);
1685
+ if ("destroy" in layer && typeof layer.destroy === "function") layer.destroy();
1686
+ }
1687
+ boundMap.clear();
1688
+ }
1689
+ onUnmounted(() => {
1690
+ dispose();
1691
+ layerGroup.value.clearLayers();
1692
+ });
1693
+ return (_ctx, _cache) => {
1694
+ return null;
1695
+ };
1696
+ }
1697
+ });
1698
+ // src/layer/mapbox/mapbox.vue
1699
+ var mapbox_default = /* @__PURE__ */ defineComponent({
1700
+ name: "AMap.Mapbox",
1701
+ inheritAttrs: false,
1702
+ __name: "mapbox",
1703
+ props: {
1704
+ tileSize: {},
1705
+ cacheSize: {},
1706
+ ce: {
1707
+ type: Boolean,
1708
+ default: void 0
1709
+ },
1710
+ depthTest: {
1711
+ type: Boolean,
1712
+ default: void 0
1713
+ },
1714
+ map: {},
1715
+ opacity: {},
1716
+ rejectMapMask: {
1717
+ type: Boolean,
1718
+ default: void 0
1719
+ },
1720
+ visible: {
1721
+ type: Boolean,
1722
+ default: void 0
1723
+ },
1724
+ zIndex: {},
1725
+ zooms: {}
1726
+ },
1727
+ emits: ["complete"],
1728
+ setup(__props, { expose: __expose, emit: __emit }) {
1729
+ const props = __props;
1730
+ const emits = __emit;
1731
+ const mapboxEvents = layerEvents;
1732
+ const map = useMapInstance(props);
1733
+ const restProps = shallowReactiveOmit(props, "map");
1734
+ const mapbox = shallowRef(new AMap.Mapbox(toDefinedRaw(restProps)));
1735
+ watchEffect((onCleanup) => {
1736
+ if (!map.value) return;
1737
+ mapbox.value.setMap(map.value);
1738
+ onCleanup(() => {
1739
+ mapbox.value.setMap(null);
1740
+ });
1741
+ });
1742
+ onUnmounted(() => mapbox.value.destroy());
1743
+ useLayerAttributes(mapbox, props);
1744
+ use_event_listeners_default(mapbox, emits, mapboxEvents);
1745
+ __expose({ instance: mapbox });
1746
+ return (_ctx, _cache) => {
1747
+ return null;
1748
+ };
1749
+ }
1750
+ });
1751
+ // src/layer/tile-layer/tile-layer/use-attributes.ts
1752
+ function useTileLayerAttributes(tileLayer, props) {
1753
+ useLayerAttributes(tileLayer, props);
1754
+ watch(() => props.getTileUrl, (val) => {
1755
+ if (typeof val === "string") tileLayer.value.setTileUrl(val);
1756
+ });
1757
+ }
1758
+ // src/layer/tile-layer/tile-layer/tile-layer.vue
1759
+ var tile_layer_default = /* @__PURE__ */ defineComponent({
1760
+ name: "AMap.TileLayer",
1761
+ inheritAttrs: false,
1762
+ __name: "tile-layer",
1763
+ props: {
1764
+ getTileUrl: {},
1765
+ name: {},
1766
+ id: {},
1767
+ dataZooms: {},
1768
+ detectRetina: {
1769
+ type: Boolean,
1770
+ default: void 0
1771
+ },
1772
+ projection: {},
1773
+ tileUrl: {},
1774
+ tileSize: {},
1775
+ zIndex: {},
1776
+ cacheSize: {},
1777
+ ce: {
1778
+ type: Boolean,
1779
+ default: void 0
1780
+ },
1781
+ depthTest: {
1782
+ type: Boolean,
1783
+ default: void 0
1784
+ },
1785
+ map: {},
1786
+ opacity: {},
1787
+ rejectMapMask: {
1788
+ type: Boolean,
1789
+ default: void 0
1790
+ },
1791
+ visible: {
1792
+ type: Boolean,
1793
+ default: void 0
1794
+ },
1795
+ zooms: {}
1796
+ },
1797
+ emits: ["complete"],
1798
+ setup(__props, { expose: __expose, emit: __emit }) {
1799
+ const props = __props;
1800
+ const emits = __emit;
1801
+ const tileLayerEvents = layerEvents;
1802
+ const map = useMapInstance(props);
1803
+ const restProps = shallowReactiveOmit(props, "map");
1804
+ const tileLayer = shallowRef(new AMap.TileLayer(toDefinedRaw(restProps)));
1805
+ watchEffect((onCleanup) => {
1806
+ if (!map.value) return;
1807
+ tileLayer.value.setMap(map.value);
1808
+ onCleanup(() => {
1809
+ tileLayer.value.setMap(null);
1810
+ });
1811
+ });
1812
+ onUnmounted(() => tileLayer.value.destroy());
1813
+ useTileLayerAttributes(tileLayer, props);
1814
+ use_event_listeners_default(tileLayer, emits, tileLayerEvents);
1815
+ __expose({ instance: tileLayer });
1816
+ return (_ctx, _cache) => {
1817
+ return null;
1818
+ };
1819
+ }
1820
+ });
1821
+ // src/layer/tile-layer/flexible/flexible.vue
1822
+ var flexible_default = /* @__PURE__ */ defineComponent({
1823
+ name: "AMap.TileLayer.Flexible",
1824
+ inheritAttrs: false,
1825
+ __name: "flexible",
1826
+ props: {
1827
+ createTile: {},
1828
+ getTileUrl: {},
1829
+ name: {},
1830
+ id: {},
1831
+ dataZooms: {},
1832
+ detectRetina: {
1833
+ type: Boolean,
1834
+ default: void 0
1835
+ },
1836
+ projection: {},
1837
+ tileUrl: {},
1838
+ tileSize: {},
1839
+ zIndex: {},
1840
+ cacheSize: {},
1841
+ ce: {
1842
+ type: Boolean,
1843
+ default: void 0
1844
+ },
1845
+ depthTest: {
1846
+ type: Boolean,
1847
+ default: void 0
1848
+ },
1849
+ map: {},
1850
+ opacity: {},
1851
+ rejectMapMask: {
1852
+ type: Boolean,
1853
+ default: void 0
1854
+ },
1855
+ visible: {
1856
+ type: Boolean,
1857
+ default: void 0
1858
+ },
1859
+ zooms: {}
1860
+ },
1861
+ emits: ["complete"],
1862
+ setup(__props, { expose: __expose, emit: __emit }) {
1863
+ const props = __props;
1864
+ const emits = __emit;
1865
+ const flexibleEvents = layerEvents;
1866
+ const map = useMapInstance(props);
1867
+ const restProps = shallowReactiveOmit(props, "map");
1868
+ const flexible = shallowRef(new AMap.TileLayer.Flexible(toDefinedRaw(restProps)));
1869
+ watchEffect((onCleanup) => {
1870
+ if (!map.value) return;
1871
+ flexible.value.setMap(map.value);
1872
+ onCleanup(() => {
1873
+ flexible.value.setMap(null);
1874
+ });
1875
+ });
1876
+ onUnmounted(() => flexible.value.destroy());
1877
+ useTileLayerAttributes(flexible, props);
1878
+ use_event_listeners_default(flexible, emits, flexibleEvents);
1879
+ __expose({ instance: flexible });
1880
+ return (_ctx, _cache) => {
1881
+ return null;
1882
+ };
1883
+ }
1884
+ });
1885
+ // src/layer/tile-layer/mark/mark.vue
1886
+ var mark_default = /* @__PURE__ */ defineComponent({
1887
+ name: "AMap.TileLayer.Mark",
1888
+ inheritAttrs: false,
1889
+ __name: "mark",
1890
+ props: {
1891
+ opacity: {},
1892
+ visible: {
1893
+ type: Boolean,
1894
+ default: void 0
1895
+ },
1896
+ zIndex: {},
1897
+ zooms: {},
1898
+ getTileUrl: {},
1899
+ name: {},
1900
+ id: {},
1901
+ dataZooms: {},
1902
+ detectRetina: {
1903
+ type: Boolean,
1904
+ default: void 0
1905
+ },
1906
+ projection: {},
1907
+ tileUrl: {},
1908
+ tileSize: {},
1909
+ cacheSize: {},
1910
+ ce: {
1911
+ type: Boolean,
1912
+ default: void 0
1913
+ },
1914
+ depthTest: {
1915
+ type: Boolean,
1916
+ default: void 0
1917
+ },
1918
+ map: {},
1919
+ rejectMapMask: {
1920
+ type: Boolean,
1921
+ default: void 0
1922
+ }
1923
+ },
1924
+ emits: ["complete"],
1925
+ setup(__props, { expose: __expose, emit: __emit }) {
1926
+ const props = __props;
1927
+ const emits = __emit;
1928
+ const markEvents = layerEvents;
1929
+ const map = useMapInstance(props);
1930
+ const restProps = shallowReactiveOmit(props, "map");
1931
+ const mark = shallowRef(new AMap.TileLayer.Mark(toDefinedRaw(restProps)));
1932
+ watchEffect((onCleanup) => {
1933
+ if (!map.value) return;
1934
+ mark.value.setMap(map.value);
1935
+ onCleanup(() => {
1936
+ mark.value.setMap(null);
1937
+ });
1938
+ });
1939
+ onUnmounted(() => mark.value.destroy());
1940
+ useTileLayerAttributes(mark, props);
1941
+ use_event_listeners_default(mark, emits, markEvents);
1942
+ __expose({ instance: mark });
1943
+ return (_ctx, _cache) => {
1944
+ return null;
1945
+ };
1946
+ }
1947
+ });
1948
+ // src/layer/tile-layer/road-net/road-net.vue
1949
+ var road_net_default = /* @__PURE__ */ defineComponent({
1950
+ name: "AMap.TileLayer.RoadNet",
1951
+ inheritAttrs: false,
1952
+ __name: "road-net",
1953
+ props: {
1954
+ getTileUrl: {},
1955
+ name: {},
1956
+ id: {},
1957
+ dataZooms: {},
1958
+ detectRetina: {
1959
+ type: Boolean,
1960
+ default: void 0
1961
+ },
1962
+ projection: {},
1963
+ tileUrl: {},
1964
+ tileSize: {},
1965
+ zIndex: {},
1966
+ cacheSize: {},
1967
+ ce: {
1968
+ type: Boolean,
1969
+ default: void 0
1970
+ },
1971
+ depthTest: {
1972
+ type: Boolean,
1973
+ default: void 0
1974
+ },
1975
+ map: {},
1976
+ opacity: {},
1977
+ rejectMapMask: {
1978
+ type: Boolean,
1979
+ default: void 0
1980
+ },
1981
+ visible: {
1982
+ type: Boolean,
1983
+ default: void 0
1984
+ },
1985
+ zooms: {}
1986
+ },
1987
+ emits: ["complete"],
1988
+ setup(__props, { expose: __expose, emit: __emit }) {
1989
+ const props = __props;
1990
+ const emits = __emit;
1991
+ const roadNetEvents = layerEvents;
1992
+ const map = useMapInstance(props);
1993
+ const restProps = shallowReactiveOmit(props, "map");
1994
+ const roadNet = shallowRef(new AMap.TileLayer.RoadNet(toDefinedRaw(restProps)));
1995
+ watchEffect((onCleanup) => {
1996
+ if (!map.value) return;
1997
+ roadNet.value.setMap(map.value);
1998
+ onCleanup(() => {
1999
+ roadNet.value.setMap(null);
2000
+ });
2001
+ });
2002
+ onUnmounted(() => roadNet.value.destroy());
2003
+ useTileLayerAttributes(roadNet, props);
2004
+ use_event_listeners_default(roadNet, emits, roadNetEvents);
2005
+ __expose({ instance: roadNet });
2006
+ return (_ctx, _cache) => {
2007
+ return null;
2008
+ };
2009
+ }
2010
+ });
2011
+ // src/layer/tile-layer/satellite/satellite.vue
2012
+ var satellite_default = /* @__PURE__ */ defineComponent({
2013
+ name: "AMap.TileLayer.Satellite",
2014
+ inheritAttrs: false,
2015
+ __name: "satellite",
2016
+ props: {
2017
+ cacheSize: {},
2018
+ ce: {
2019
+ type: Boolean,
2020
+ default: void 0
2021
+ },
2022
+ depthTest: {
2023
+ type: Boolean,
2024
+ default: void 0
2025
+ },
2026
+ map: {},
2027
+ opacity: {},
2028
+ rejectMapMask: {
2029
+ type: Boolean,
2030
+ default: void 0
2031
+ },
2032
+ visible: {
2033
+ type: Boolean,
2034
+ default: void 0
2035
+ },
2036
+ zIndex: {},
2037
+ zooms: {}
2038
+ },
2039
+ emits: ["complete"],
2040
+ setup(__props, { expose: __expose, emit: __emit }) {
2041
+ const props = __props;
2042
+ const emits = __emit;
2043
+ const satelliteEvents = layerEvents;
2044
+ const map = useMapInstance(props);
2045
+ const restProps = shallowReactiveOmit(props, "map");
2046
+ const satellite = shallowRef(new AMap.TileLayer.Satellite(toDefinedRaw(restProps)));
2047
+ watchEffect((onCleanup) => {
2048
+ if (!map.value) return;
2049
+ satellite.value.setMap(map.value);
2050
+ onCleanup(() => {
2051
+ satellite.value.setMap(null);
2052
+ });
2053
+ });
2054
+ onUnmounted(() => satellite.value.destroy());
2055
+ useTileLayerAttributes(satellite, props);
2056
+ use_event_listeners_default(satellite, emits, satelliteEvents);
2057
+ __expose({ instance: satellite });
2058
+ return (_ctx, _cache) => {
2059
+ return null;
2060
+ };
2061
+ }
2062
+ });
2063
+ // src/layer/tile-layer/traffic/traffic.vue
2064
+ var traffic_default = /* @__PURE__ */ defineComponent({
2065
+ name: "AMap.TileLayer.Traffic",
2066
+ inheritAttrs: false,
2067
+ __name: "traffic",
2068
+ props: {
2069
+ autoRefresh: {
2070
+ type: Boolean,
2071
+ default: void 0
2072
+ },
2073
+ interval: {},
2074
+ cacheSize: {},
2075
+ ce: {
2076
+ type: Boolean,
2077
+ default: void 0
2078
+ },
2079
+ depthTest: {
2080
+ type: Boolean,
2081
+ default: void 0
2082
+ },
2083
+ map: {},
2084
+ opacity: {},
2085
+ rejectMapMask: {
2086
+ type: Boolean,
2087
+ default: void 0
2088
+ },
2089
+ visible: {
2090
+ type: Boolean,
2091
+ default: void 0
2092
+ },
2093
+ zIndex: {},
2094
+ zooms: {}
2095
+ },
2096
+ emits: ["complete"],
2097
+ setup(__props, { expose: __expose, emit: __emit }) {
2098
+ const props = __props;
2099
+ const emits = __emit;
2100
+ const trafficEvents = layerEvents;
2101
+ const map = useMapInstance(props);
2102
+ const restProps = shallowReactiveOmit(props, "map");
2103
+ const traffic = shallowRef(new AMap.TileLayer.Traffic(toDefinedRaw(restProps)));
2104
+ watchEffect((onCleanup) => {
2105
+ if (!map.value) return;
2106
+ traffic.value.setMap(map.value);
2107
+ onCleanup(() => {
2108
+ traffic.value.setMap(null);
2109
+ });
2110
+ });
2111
+ onUnmounted(() => traffic.value.destroy());
2112
+ useTileLayerAttributes(traffic, props);
2113
+ use_event_listeners_default(traffic, emits, trafficEvents);
2114
+ __expose({ instance: traffic });
2115
+ return (_ctx, _cache) => {
2116
+ return null;
2117
+ };
2118
+ }
2119
+ });
2120
+ // src/layer/tile-layer/wms/wms.vue
2121
+ var wms_default = /* @__PURE__ */ defineComponent({
2122
+ name: "AMap.TileLayer.WMS",
2123
+ inheritAttrs: false,
2124
+ __name: "wms",
2125
+ props: {
2126
+ blend: {
2127
+ type: Boolean,
2128
+ default: void 0
2129
+ },
2130
+ params: {},
2131
+ url: {},
2132
+ getTileUrl: {},
2133
+ name: {},
2134
+ id: {},
2135
+ dataZooms: {},
2136
+ detectRetina: {
2137
+ type: Boolean,
2138
+ default: void 0
2139
+ },
2140
+ projection: {},
2141
+ tileUrl: {},
2142
+ tileSize: {},
2143
+ zIndex: {},
2144
+ cacheSize: {},
2145
+ ce: {
2146
+ type: Boolean,
2147
+ default: void 0
2148
+ },
2149
+ depthTest: {
2150
+ type: Boolean,
2151
+ default: void 0
2152
+ },
2153
+ map: {},
2154
+ opacity: {},
2155
+ rejectMapMask: {
2156
+ type: Boolean,
2157
+ default: void 0
2158
+ },
2159
+ visible: {
2160
+ type: Boolean,
2161
+ default: void 0
2162
+ },
2163
+ zooms: {}
2164
+ },
2165
+ emits: ["complete"],
2166
+ setup(__props, { expose: __expose, emit: __emit }) {
2167
+ const props = __props;
2168
+ const emits = __emit;
2169
+ const wmsEvents = layerEvents;
2170
+ const map = useMapInstance(props);
2171
+ const restProps = shallowReactiveOmit(props, "map");
2172
+ const wms = shallowRef(new AMap.TileLayer.WMS(toDefinedRaw(restProps)));
2173
+ watchEffect((onCleanup) => {
2174
+ if (!map.value) return;
2175
+ wms.value.setMap(map.value);
2176
+ onCleanup(() => {
2177
+ wms.value.setMap(null);
2178
+ });
2179
+ });
2180
+ onUnmounted(() => wms.value.destroy());
2181
+ useTileLayerAttributes(wms, props);
2182
+ use_event_listeners_default(wms, emits, wmsEvents);
2183
+ __expose({ instance: wms });
2184
+ return (_ctx, _cache) => {
2185
+ return null;
2186
+ };
2187
+ }
2188
+ });
2189
+ // src/layer/tile-layer/wmts/wmts.vue
2190
+ var wmts_default = /* @__PURE__ */ defineComponent({
2191
+ name: "AMap.TileLayer.WMTS",
2192
+ inheritAttrs: false,
2193
+ __name: "wmts",
2194
+ props: {
2195
+ blend: {
2196
+ type: Boolean,
2197
+ default: void 0
2198
+ },
2199
+ params: {},
2200
+ url: {},
2201
+ getTileUrl: {},
2202
+ name: {},
2203
+ id: {},
2204
+ dataZooms: {},
2205
+ detectRetina: {
2206
+ type: Boolean,
2207
+ default: void 0
2208
+ },
2209
+ projection: {},
2210
+ tileUrl: {},
2211
+ tileSize: {},
2212
+ zIndex: {},
2213
+ cacheSize: {},
2214
+ ce: {
2215
+ type: Boolean,
2216
+ default: void 0
2217
+ },
2218
+ depthTest: {
2219
+ type: Boolean,
2220
+ default: void 0
2221
+ },
2222
+ map: {},
2223
+ opacity: {},
2224
+ rejectMapMask: {
2225
+ type: Boolean,
2226
+ default: void 0
2227
+ },
2228
+ visible: {
2229
+ type: Boolean,
2230
+ default: void 0
2231
+ },
2232
+ zooms: {}
2233
+ },
2234
+ emits: ["complete"],
2235
+ setup(__props, { expose: __expose, emit: __emit }) {
2236
+ const props = __props;
2237
+ const emits = __emit;
2238
+ const wmtsEvents = layerEvents;
2239
+ const map = useMapInstance(props);
2240
+ const restProps = shallowReactiveOmit(props, "map");
2241
+ const wmts = shallowRef(new AMap.TileLayer.WMTS(toDefinedRaw(restProps)));
2242
+ watchEffect((onCleanup) => {
2243
+ if (!map.value) return;
2244
+ wmts.value.setMap(map.value);
2245
+ onCleanup(() => {
2246
+ wmts.value.setMap(null);
2247
+ });
2248
+ });
2249
+ onUnmounted(() => wmts.value.destroy());
2250
+ useTileLayerAttributes(wmts, props);
2251
+ use_event_listeners_default(wmts, emits, wmtsEvents);
2252
+ __expose({ instance: wmts });
2253
+ return (_ctx, _cache) => {
2254
+ return null;
2255
+ };
2256
+ }
2257
+ });
2258
+ // src/layer/mapbox-vector-tile-layer/mapbox-vector-tile-layer.vue
2259
+ var mapbox_vector_tile_layer_default = /* @__PURE__ */ defineComponent({
2260
+ name: "AMap.MapboxVectorTileLayer",
2261
+ inheritAttrs: false,
2262
+ __name: "mapbox-vector-tile-layer",
2263
+ props: {
2264
+ styles: {},
2265
+ url: {},
2266
+ getTileUrl: {},
2267
+ name: {},
2268
+ id: {},
2269
+ dataZooms: {},
2270
+ detectRetina: {
2271
+ type: Boolean,
2272
+ default: void 0
2273
+ },
2274
+ projection: {},
2275
+ tileUrl: {},
2276
+ tileSize: {},
2277
+ zIndex: {},
2278
+ cacheSize: {},
2279
+ ce: {
2280
+ type: Boolean,
2281
+ default: void 0
2282
+ },
2283
+ depthTest: {
2284
+ type: Boolean,
2285
+ default: void 0
2286
+ },
2287
+ map: {},
2288
+ opacity: {},
2289
+ rejectMapMask: {
2290
+ type: Boolean,
2291
+ default: void 0
2292
+ },
2293
+ visible: {
2294
+ type: Boolean,
2295
+ default: void 0
2296
+ },
2297
+ zooms: {}
2298
+ },
2299
+ emits: ["complete"],
2300
+ setup(__props, { expose: __expose, emit: __emit }) {
2301
+ const props = __props;
2302
+ const emits = __emit;
2303
+ const mvtLayerEvents = layerEvents;
2304
+ const map = useMapInstance(props);
2305
+ const restProps = shallowReactiveOmit(props, "map");
2306
+ const mvtLayer = shallowRef(new AMap.MapboxVectorTileLayer(toDefinedRaw(restProps)));
2307
+ watchEffect((onCleanup) => {
2308
+ if (!map.value) return;
2309
+ mvtLayer.value.setMap(map.value);
2310
+ onCleanup(() => {
2311
+ mvtLayer.value.getLabelsLayer().setMap(null);
2312
+ mvtLayer.value.setMap(null);
2313
+ });
2314
+ });
2315
+ onUnmounted(() => {
2316
+ mvtLayer.value.getLabelsLayer().destroy();
2317
+ mvtLayer.value.destroy();
2318
+ });
2319
+ useTileLayerAttributes(mvtLayer, props);
2320
+ watch(() => props.styles, (val) => {
2321
+ if (val !== void 0) mvtLayer.value.setStyle(toRaw(val));
2322
+ });
2323
+ use_event_listeners_default(mvtLayer, emits, mvtLayerEvents);
2324
+ __expose({ instance: mvtLayer });
2325
+ return (_ctx, _cache) => {
2326
+ return null;
2327
+ };
2328
+ }
2329
+ });
2330
+ // src/layer/vector-layer/context.ts
2331
+ const AMap_Symbol_VectorLayer = Symbol("VectorLayer");
2332
+ /**
2333
+ * 设置VectorLayer实例Context
2334
+ * @param {ShallowRef<AMap.VectorLayer>} vectorLayer - VectorLayer实例ref
2335
+ */
2336
+ function setVectorLayerContext(vectorLayer) {
2337
+ provide(AMap_Symbol_VectorLayer, vectorLayer);
2338
+ }
2339
+ /**
2340
+ * 获取VectorLayer实例ref
2341
+ * @returns {ShallowRef<AMap.VectorLayer>} - VectorLayer实例ref
2342
+ */
2343
+ function useVectorLayer() {
2344
+ const context = inject(AMap_Symbol_VectorLayer);
2345
+ if (!context) throw lostContextError("`AMap.VectorLayer`");
2346
+ return context;
2347
+ }
2348
+ /**
2349
+ * 获取VectorLayer实例ref
2350
+ * @returns {ShallowRef<AMap.VectorLayer> | undefined} - VectorLayer实例ref或 `undefined`
2351
+ */
2352
+ function useVectorLayerInstance() {
2353
+ return inject(AMap_Symbol_VectorLayer, void 0);
2354
+ }
2355
+ // src/layer/vector-layer/vector-layer.vue
2356
+ var vector_layer_default = /* @__PURE__ */ defineComponent({
2357
+ name: "AMap.VectorLayer",
2358
+ inheritAttrs: false,
2359
+ __name: "vector-layer",
2360
+ props: {
2361
+ zIndex: {},
2362
+ cacheSize: {},
2363
+ ce: {
2364
+ type: Boolean,
2365
+ default: void 0
2366
+ },
2367
+ depthTest: {
2368
+ type: Boolean,
2369
+ default: void 0
2370
+ },
2371
+ map: {},
2372
+ opacity: {},
2373
+ rejectMapMask: {
2374
+ type: Boolean,
2375
+ default: void 0
2376
+ },
2377
+ visible: {
2378
+ type: Boolean,
2379
+ default: void 0
2380
+ },
2381
+ zooms: {}
2382
+ },
2383
+ setup(__props, { expose: __expose }) {
2384
+ const props = __props;
2385
+ const map = useMapInstance(props);
2386
+ const restProps = shallowReactiveOmit(props, "map");
2387
+ const vectorLayer = shallowRef(new AMap.VectorLayer(toDefinedRaw(restProps)));
2388
+ watchEffect((onCleanup) => {
2389
+ if (!map.value) return;
2390
+ vectorLayer.value.setMap(map.value);
2391
+ onCleanup(() => {
2392
+ vectorLayer.value.setMap(null);
2393
+ });
2394
+ });
2395
+ onUnmounted(() => vectorLayer.value.destroy());
2396
+ useLayerAttributes(vectorLayer, props);
2397
+ setVectorLayerContext(vectorLayer);
2398
+ __expose({ instance: vectorLayer });
2399
+ return (_ctx, _cache) => {
2400
+ return renderSlot(_ctx.$slots, "default");
2401
+ };
2402
+ }
2403
+ });
2404
+ // src/overlay/vector-overlay/vector-overlay.ts
2405
+ const vectorOverlayEvents = [
2406
+ hide,
2407
+ show,
2408
+ click,
2409
+ dblClick,
2410
+ rightClick,
2411
+ mouseDown,
2412
+ mouseUp,
2413
+ mouseOver,
2414
+ mouseOut,
2415
+ dragStart,
2416
+ dragging,
2417
+ dragEnd,
2418
+ touchStart,
2419
+ touchMove,
2420
+ touchEnd
2421
+ ];
2422
+ function useVectorOverlayAttributes(overlay, props) {
2423
+ watch(() => props.draggable, (val) => {
2424
+ if (val !== void 0) overlay.value.setDraggable(val);
2425
+ });
2426
+ watch(() => props.extData, (val) => {
2427
+ overlay.value.setExtData(toRaw(val));
2428
+ });
2429
+ watch(() => props.visible, (val) => {
2430
+ if (val !== void 0) {
2431
+ if (val) overlay.value.show();
2432
+ else overlay.value.hide();
2433
+ }
2434
+ });
2435
+ }
2436
+ // src/overlay/bezier-curve/bezier-curve.vue
2437
+ var bezier_curve_default = /* @__PURE__ */ defineComponent({
2438
+ name: "AMap.BezierCurve",
2439
+ inheritAttrs: false,
2440
+ __name: "bezier-curve",
2441
+ props: {
2442
+ map: {},
2443
+ visible: {
2444
+ type: Boolean,
2445
+ default: void 0
2446
+ },
2447
+ path: {},
2448
+ borderWeight: {},
2449
+ dirColor: {},
2450
+ dirImg: {},
2451
+ geodesic: {
2452
+ type: Boolean,
2453
+ default: void 0
2454
+ },
2455
+ height: {},
2456
+ isOutLine: {
2457
+ type: Boolean,
2458
+ default: void 0
2459
+ },
2460
+ lineCap: {},
2461
+ lineGradient: {},
2462
+ lineJoin: {},
2463
+ outlineColor: {},
2464
+ showDir: {
2465
+ type: Boolean,
2466
+ default: void 0
2467
+ },
2468
+ cursor: {},
2469
+ draggable: {
2470
+ type: Boolean,
2471
+ default: void 0
2472
+ },
2473
+ extData: {},
2474
+ strokeColor: {},
2475
+ strokeDasharray: {},
2476
+ strokeOpacity: {},
2477
+ strokeStyle: {},
2478
+ strokeWeight: {},
2479
+ zIndex: {},
2480
+ zooms: {}
2481
+ },
2482
+ emits: [
2483
+ "hide",
2484
+ "show",
2485
+ "click",
2486
+ "dblClick",
2487
+ "rightClick",
2488
+ "mouseDown",
2489
+ "mouseUp",
2490
+ "mouseOver",
2491
+ "mouseOut",
2492
+ "dragStart",
2493
+ "dragging",
2494
+ "dragEnd",
2495
+ "touchStart",
2496
+ "touchMove",
2497
+ "touchEnd"
2498
+ ],
2499
+ setup(__props, { expose: __expose, emit: __emit }) {
2500
+ const props = __props;
2501
+ const emits = __emit;
2502
+ const bezierCurveEvents = vectorOverlayEvents;
2503
+ const map = useMapInstance(props);
2504
+ const restProps = shallowReactiveOmit(props, "map");
2505
+ const vectorLayer = useVectorLayerInstance();
2506
+ const bezierCurve = shallowRef(new AMap.BezierCurve(toDefinedRaw(restProps)));
2507
+ watchEffect((onCleanup) => {
2508
+ if (vectorLayer) vectorLayer.value.add(bezierCurve.value);
2509
+ else map.value?.add(bezierCurve.value);
2510
+ onCleanup(() => {
2511
+ if (vectorLayer) vectorLayer.value.remove(bezierCurve.value);
2512
+ else map.value?.remove(bezierCurve.value);
2513
+ });
2514
+ });
2515
+ useVectorOverlayAttributes(bezierCurve, props);
2516
+ watch(() => props.path, (val) => {
2517
+ bezierCurve.value.setPath(toRaw(val));
2518
+ bezierCurve.value.setOptions({ path: toRaw(val) });
2519
+ });
2520
+ watch(shallowReactiveOmit(props, [
2521
+ "map",
2522
+ "draggable",
2523
+ "extData",
2524
+ "visible",
2525
+ "path"
2526
+ ]), (val) => {
2527
+ bezierCurve.value.setOptions(toDefinedRaw(val));
2528
+ });
2529
+ use_event_listeners_default(bezierCurve, emits, bezierCurveEvents);
2530
+ onUnmounted(() => bezierCurve.value.destroy());
2531
+ __expose({ instance: bezierCurve });
2532
+ return (_ctx, _cache) => {
2533
+ return null;
2534
+ };
2535
+ }
2536
+ });
2537
+ // src/overlay/circle/circle.vue
2538
+ var circle_default = /* @__PURE__ */ defineComponent({
2539
+ name: "AMap.Circle",
2540
+ inheritAttrs: false,
2541
+ __name: "circle",
2542
+ props: {
2543
+ map: {},
2544
+ visible: {
2545
+ type: Boolean,
2546
+ default: void 0
2547
+ },
2548
+ center: {},
2549
+ height: {},
2550
+ radius: {},
2551
+ async: {
2552
+ type: Boolean,
2553
+ default: void 0
2554
+ },
2555
+ bubble: {
2556
+ type: Boolean,
2557
+ default: void 0
2558
+ },
2559
+ extrusionHeight: {},
2560
+ fillColor: {},
2561
+ fillOpacity: {},
2562
+ innerOverlay: {
2563
+ type: Boolean,
2564
+ default: void 0
2565
+ },
2566
+ noSelect: {
2567
+ type: Boolean,
2568
+ default: void 0
2569
+ },
2570
+ cursor: {},
2571
+ draggable: {
2572
+ type: Boolean,
2573
+ default: void 0
2574
+ },
2575
+ extData: {},
2576
+ strokeColor: {},
2577
+ strokeDasharray: {},
2578
+ strokeOpacity: {},
2579
+ strokeStyle: {},
2580
+ strokeWeight: {},
2581
+ zIndex: {},
2582
+ zooms: {}
2583
+ },
2584
+ emits: [
2585
+ "hide",
2586
+ "show",
2587
+ "click",
2588
+ "dblClick",
2589
+ "rightClick",
2590
+ "mouseDown",
2591
+ "mouseUp",
2592
+ "mouseOver",
2593
+ "mouseOut",
2594
+ "dragStart",
2595
+ "dragging",
2596
+ "dragEnd",
2597
+ "touchStart",
2598
+ "touchMove",
2599
+ "touchEnd"
2600
+ ],
2601
+ setup(__props, { expose: __expose, emit: __emit }) {
2602
+ const props = __props;
2603
+ const emits = __emit;
2604
+ const circleEvents = vectorOverlayEvents;
2605
+ const map = useMapInstance(props);
2606
+ const restProps = shallowReactiveOmit(props, "map");
2607
+ const vectorLayer = useVectorLayerInstance();
2608
+ const circle = shallowRef(new AMap.Circle(toDefinedRaw(restProps)));
2609
+ watchEffect((onCleanup) => {
2610
+ if (vectorLayer) vectorLayer.value.add(circle.value);
2611
+ else map.value?.add(circle.value);
2612
+ onCleanup(() => {
2613
+ if (vectorLayer) vectorLayer.value.remove(circle.value);
2614
+ else map.value?.remove(circle.value);
2615
+ });
2616
+ });
2617
+ useVectorOverlayAttributes(circle, props);
2618
+ watch(() => props.center, (val) => {
2619
+ if (val !== void 0) circle.value.setCenter(toRaw(val));
2620
+ });
2621
+ watch(() => props.radius, (val) => {
2622
+ if (val !== void 0) circle.value.setRadius(val);
2623
+ });
2624
+ watch(shallowReactiveOmit(props, [
2625
+ "map",
2626
+ "draggable",
2627
+ "extData",
2628
+ "visible",
2629
+ "center",
2630
+ "radius"
2631
+ ]), (val) => {
2632
+ circle.value.setOptions(toDefinedRaw(val));
2633
+ });
2634
+ use_event_listeners_default(circle, emits, circleEvents);
2635
+ onUnmounted(() => circle.value.destroy());
2636
+ __expose({ instance: circle });
2637
+ return (_ctx, _cache) => {
2638
+ return null;
2639
+ };
2640
+ }
2641
+ });
2642
+ // src/overlay/circle-marker/circle-marker.vue
2643
+ var circle_marker_default = /* @__PURE__ */ defineComponent({
2644
+ name: "AMap.CircleMarker",
2645
+ inheritAttrs: false,
2646
+ __name: "circle-marker",
2647
+ props: {
2648
+ map: {},
2649
+ visible: {
2650
+ type: Boolean,
2651
+ default: void 0
2652
+ },
2653
+ fillColor: {},
2654
+ fillOpacity: {},
2655
+ radius: {},
2656
+ async: {
2657
+ type: Boolean,
2658
+ default: void 0
2659
+ },
2660
+ bubble: {
2661
+ type: Boolean,
2662
+ default: void 0
2663
+ },
2664
+ center: {},
2665
+ innerOverlay: {
2666
+ type: Boolean,
2667
+ default: void 0
2668
+ },
2669
+ noSelect: {
2670
+ type: Boolean,
2671
+ default: void 0
2672
+ },
2673
+ cursor: {},
2674
+ draggable: {
2675
+ type: Boolean,
2676
+ default: void 0
2677
+ },
2678
+ extData: {},
2679
+ strokeColor: {},
2680
+ strokeDasharray: {},
2681
+ strokeOpacity: {},
2682
+ strokeStyle: {},
2683
+ strokeWeight: {},
2684
+ zIndex: {},
2685
+ zooms: {}
2686
+ },
2687
+ emits: [
2688
+ "hide",
2689
+ "show",
2690
+ "click",
2691
+ "dblClick",
2692
+ "rightClick",
2693
+ "mouseDown",
2694
+ "mouseUp",
2695
+ "mouseOver",
2696
+ "mouseOut",
2697
+ "dragStart",
2698
+ "dragging",
2699
+ "dragEnd",
2700
+ "touchStart",
2701
+ "touchMove",
2702
+ "touchEnd"
2703
+ ],
2704
+ setup(__props, { expose: __expose, emit: __emit }) {
2705
+ const props = __props;
2706
+ const emits = __emit;
2707
+ const circleMarkerEvents = vectorOverlayEvents;
2708
+ const map = useMapInstance(props);
2709
+ const restProps = shallowReactiveOmit(props, "map");
2710
+ const vectorLayer = useVectorLayerInstance();
2711
+ const circleMarker = shallowRef(new AMap.CircleMarker(toDefinedRaw(restProps)));
2712
+ watchEffect((onCleanup) => {
2713
+ if (vectorLayer) vectorLayer.value.add(circleMarker.value);
2714
+ else map.value?.add(circleMarker.value);
2715
+ onCleanup(() => {
2716
+ if (vectorLayer) vectorLayer.value.remove(circleMarker.value);
2717
+ else map.value?.remove(circleMarker.value);
2718
+ });
2719
+ });
2720
+ useVectorOverlayAttributes(circleMarker, props);
2721
+ watch(() => props.center, (val) => {
2722
+ if (val !== void 0) circleMarker.value.setCenter(toRaw(val));
2723
+ });
2724
+ watch(() => props.radius, (val) => {
2725
+ if (val !== void 0) circleMarker.value.setRadius(val);
2726
+ });
2727
+ watch(shallowReactiveOmit(props, [
2728
+ "map",
2729
+ "draggable",
2730
+ "extData",
2731
+ "visible",
2732
+ "center",
2733
+ "radius"
2734
+ ]), (val) => {
2735
+ circleMarker.value.setOptions(toDefinedRaw(val));
2736
+ });
2737
+ use_event_listeners_default(circleMarker, emits, circleMarkerEvents);
2738
+ onUnmounted(() => circleMarker.value.destroy());
2739
+ __expose({ instance: circleMarker });
2740
+ return (_ctx, _cache) => {
2741
+ return null;
2742
+ };
2743
+ }
2744
+ });
2745
+ // src/overlay/dom-overlay/custom-content.vue
2746
+ var custom_content_default = /* @__PURE__ */ defineComponent({
2747
+ __name: "custom-content",
2748
+ props: { instance: {} },
2749
+ setup(__props) {
2750
+ const props = __props;
2751
+ const dom = document.createElement("div");
2752
+ props.instance.setContent(dom);
2753
+ onMounted(() => {
2754
+ const ro = new ResizeObserver(() => {
2755
+ props.instance.setContent(dom);
2756
+ });
2757
+ ro.observe(dom);
2758
+ onBeforeUnmount(() => {
2759
+ ro.disconnect();
2760
+ dom.remove();
2761
+ });
2762
+ });
2763
+ return (_ctx, _cache) => {
2764
+ return openBlock(), createBlock(Teleport, { to: unref(dom) }, [renderSlot(_ctx.$slots, "default")], 8, ["to"]);
2765
+ };
2766
+ }
2767
+ });
2768
+ // src/overlay/dom-overlay/dom-overlay.ts
2769
+ const domOverlayEvents = [
2770
+ click,
2771
+ dblClick,
2772
+ rightClick,
2773
+ dragStart,
2774
+ dragging,
2775
+ dragEnd,
2776
+ mouseDown,
2777
+ mouseUp,
2778
+ mouseOver,
2779
+ mouseOut,
2780
+ mouseMove,
2781
+ moveStart,
2782
+ moveAlong,
2783
+ moveEnd,
2784
+ moving,
2785
+ touchStart,
2786
+ touchMove,
2787
+ touchEnd
2788
+ ];
2789
+ function useDOMOverlayAttributes(overlay, props, hasChildren) {
2790
+ watch(() => props.anchor, (val) => {
2791
+ overlay.value.setAnchor(val);
2792
+ });
2793
+ watch([() => hasChildren?.value, () => props.content], ([c1, c2]) => {
2794
+ if (!c1) return;
2795
+ overlay.value.setContent(c2);
2796
+ }, { immediate: true });
2797
+ watch(() => props.offset, (val) => {
2798
+ overlay.value.setOffset(clone(toRaw(val)));
2799
+ });
2800
+ watch(() => props.orientation, (val) => {
2801
+ overlay.value.setOrientation(val);
2802
+ });
2803
+ watch(() => props.position, (val) => {
2804
+ if (val !== void 0) overlay.value.setPosition(clone(toRaw(val)));
2805
+ });
2806
+ watch(() => props.rotate, (val) => {
2807
+ if (val !== void 0) overlay.value.setAngle(val);
2808
+ });
2809
+ watch(() => props.size, (val) => {
2810
+ if (val !== void 0) overlay.value.setSize(clone(toRaw(val)));
2811
+ });
2812
+ watch(() => props.visible, (val) => {
2813
+ if (val !== void 0) {
2814
+ if (val) overlay.value.show();
2815
+ else overlay.value.hide();
2816
+ }
2817
+ });
2818
+ watch(() => props.zIndex, (val) => {
2819
+ if (val !== void 0) overlay.value.setzIndex(val);
2820
+ });
2821
+ }
2822
+ // src/overlay/context-menu/context-menu.vue
2823
+ var context_menu_default = /* @__PURE__ */ defineComponent({
2824
+ name: "AMap.ContextMenu",
2825
+ inheritAttrs: false,
2826
+ __name: "context-menu",
2827
+ props: {
2828
+ aliveWhenMapClick: {
2829
+ type: Boolean,
2830
+ default: void 0
2831
+ },
2832
+ content: {},
2833
+ anchor: {},
2834
+ innerOverlay: {
2835
+ type: Boolean,
2836
+ default: void 0
2837
+ },
2838
+ isCustom: {
2839
+ type: Boolean,
2840
+ default: void 0
2841
+ },
2842
+ map: {},
2843
+ noSelect: {
2844
+ type: Boolean,
2845
+ default: void 0
2846
+ },
2847
+ offset: {},
2848
+ orientation: {},
2849
+ position: {},
2850
+ rotate: {},
2851
+ scale: {},
2852
+ visible: {
2853
+ type: Boolean,
2854
+ default: void 0
2855
+ },
2856
+ size: {},
2857
+ zIndex: {},
2858
+ zooms: {}
2859
+ },
2860
+ emits: ["close", "open"],
2861
+ setup(__props, { expose: __expose, emit: __emit }) {
2862
+ const props = __props;
2863
+ const emits = __emit;
2864
+ const contextMenuEvents = [close, open];
2865
+ patchContextMenu();
2866
+ const restProps = shallowReactiveOmit(props, "map");
2867
+ const contextMenu = shallowRef(new AMap.ContextMenu(toDefinedRaw(restProps)));
2868
+ const slots = useSlots();
2869
+ useDOMOverlayAttributes(contextMenu, props, computed(() => slots.default !== void 0));
2870
+ use_event_listeners_default(contextMenu, emits, contextMenuEvents);
2871
+ onUnmounted(() => {
2872
+ if (contextMenu.value._parent?._container?.contains(contextMenu.value.getContentDom())) contextMenu.value.remove();
2873
+ contextMenu.value.destroy();
2874
+ });
2875
+ __expose({ instance: contextMenu });
2876
+ return (_ctx, _cache) => {
2877
+ return _ctx.$slots.default ? (openBlock(), createBlock(unref(custom_content_default), {
2878
+ key: 0,
2879
+ instance: contextMenu.value
2880
+ }, {
2881
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2882
+ _: 3
2883
+ }, 8, ["instance"])) : createCommentVNode("v-if", true);
2884
+ };
2885
+ }
2886
+ });
2887
+ // src/overlay/marker/use-attributes.ts
2888
+ function useMarkerAttributes(marker, props, hasChildren) {
2889
+ watch(() => props.clickable, (val) => {
2890
+ marker.value.setClickable(val);
2891
+ });
2892
+ watch(() => props.cursor, (val) => {
2893
+ marker.value.setCursor(val);
2894
+ });
2895
+ watch(() => props.draggable, (val) => {
2896
+ if (val !== void 0) marker.value.setDraggable(val);
2897
+ });
2898
+ watch(() => props.extData, (val) => {
2899
+ marker.value.setExtData(toRaw(val));
2900
+ });
2901
+ watch(() => props.icon, (val) => {
2902
+ marker.value.setIcon(clone(toRaw(val)));
2903
+ });
2904
+ watch(() => props.isTop, (val) => {
2905
+ marker.value.setTop(val);
2906
+ });
2907
+ watch(() => props.label, (val) => {
2908
+ if (val !== void 0) marker.value.setLabel(clone(toRaw(val)));
2909
+ });
2910
+ watch(() => props.title, (val) => {
2911
+ if (val !== void 0) marker.value.setTitle(clone(toRaw(val)));
2912
+ });
2913
+ watch(shallowReactiveOmit(props, "anchor", "content", "offset", "orientation", "position", "rotate", "size", "visible", "zIndex", "clickable", "cursor", "draggable", "extData", "icon", "isTop", "label", "title"), (val) => {
2914
+ marker.value.setOptions(toDefinedRaw(val));
2915
+ });
2916
+ useDOMOverlayAttributes(marker, props, hasChildren);
2917
+ }
2918
+ // src/overlay/marker/marker.vue
2919
+ var marker_default = /* @__PURE__ */ defineComponent({
2920
+ name: "AMap.Marker",
2921
+ inheritAttrs: false,
2922
+ __name: "marker",
2923
+ props: {
2924
+ isTop: {
2925
+ type: Boolean,
2926
+ default: void 0
2927
+ },
2928
+ bubble: {
2929
+ type: Boolean,
2930
+ default: void 0
2931
+ },
2932
+ clickable: {
2933
+ type: Boolean,
2934
+ default: void 0
2935
+ },
2936
+ cursor: {},
2937
+ draggable: {
2938
+ type: Boolean,
2939
+ default: void 0
2940
+ },
2941
+ extData: {},
2942
+ icon: {},
2943
+ title: {},
2944
+ topWhenClick: {
2945
+ type: Boolean,
2946
+ default: void 0
2947
+ },
2948
+ label: {},
2949
+ anchor: {},
2950
+ innerOverlay: {
2951
+ type: Boolean,
2952
+ default: void 0
2953
+ },
2954
+ isCustom: {
2955
+ type: Boolean,
2956
+ default: void 0
2957
+ },
2958
+ map: {},
2959
+ noSelect: {
2960
+ type: Boolean,
2961
+ default: void 0
2962
+ },
2963
+ offset: {},
2964
+ orientation: {},
2965
+ position: {},
2966
+ rotate: {},
2967
+ scale: {},
2968
+ visible: {
2969
+ type: Boolean,
2970
+ default: void 0
2971
+ },
2972
+ content: {},
2973
+ size: {},
2974
+ zIndex: {},
2975
+ zooms: {}
2976
+ },
2977
+ emits: [
2978
+ "click",
2979
+ "dblClick",
2980
+ "rightClick",
2981
+ "dragStart",
2982
+ "dragging",
2983
+ "dragEnd",
2984
+ "mouseDown",
2985
+ "mouseUp",
2986
+ "mouseOver",
2987
+ "mouseOut",
2988
+ "mouseMove",
2989
+ "moveStart",
2990
+ "moveAlong",
2991
+ "moveEnd",
2992
+ "moving",
2993
+ "touchStart",
2994
+ "touchMove",
2995
+ "touchEnd"
2996
+ ],
2997
+ setup(__props, { expose: __expose, emit: __emit }) {
2998
+ const props = __props;
2999
+ const emits = __emit;
3000
+ const markerEvents = domOverlayEvents;
3001
+ const map = useMapInstance(props);
3002
+ const restProps = shallowReactiveOmit(props, "map");
3003
+ const marker = shallowRef(new AMap.Marker(toDefinedRaw(restProps)));
3004
+ watchEffect((onCleanup) => {
3005
+ map.value?.add(marker.value);
3006
+ onCleanup(() => {
3007
+ map.value?.remove(marker.value);
3008
+ });
3009
+ });
3010
+ const slots = useSlots();
3011
+ useMarkerAttributes(marker, restProps, computed(() => slots.default !== void 0));
3012
+ use_event_listeners_default(marker, emits, markerEvents);
3013
+ onUnmounted(() => marker.value.destroy());
3014
+ __expose({ instance: marker });
3015
+ return (_ctx, _cache) => {
3016
+ return _ctx.$slots.default ? (openBlock(), createBlock(unref(custom_content_default), {
3017
+ key: 0,
3018
+ instance: marker.value
3019
+ }, {
3020
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3021
+ _: 3
3022
+ }, 8, ["instance"])) : createCommentVNode("v-if", true);
3023
+ };
3024
+ }
3025
+ });
3026
+ // src/overlay/elastic-marker/elastic-marker.vue
3027
+ var elastic_marker_default = /* @__PURE__ */ defineComponent({
3028
+ name: "AMap.ElasticMarker",
3029
+ inheritAttrs: false,
3030
+ __name: "elastic-marker",
3031
+ props: {
3032
+ isTop: {
3033
+ type: Boolean,
3034
+ default: void 0
3035
+ },
3036
+ styles: {},
3037
+ zoomStyleMapping: {},
3038
+ bubble: {
3039
+ type: Boolean,
3040
+ default: void 0
3041
+ },
3042
+ clickable: {
3043
+ type: Boolean,
3044
+ default: void 0
3045
+ },
3046
+ cursor: {},
3047
+ draggable: {
3048
+ type: Boolean,
3049
+ default: void 0
3050
+ },
3051
+ extData: {},
3052
+ icon: {},
3053
+ title: {},
3054
+ topWhenClick: {
3055
+ type: Boolean,
3056
+ default: void 0
3057
+ },
3058
+ label: {},
3059
+ anchor: {},
3060
+ innerOverlay: {
3061
+ type: Boolean,
3062
+ default: void 0
3063
+ },
3064
+ isCustom: {
3065
+ type: Boolean,
3066
+ default: void 0
3067
+ },
3068
+ map: {},
3069
+ noSelect: {
3070
+ type: Boolean,
3071
+ default: void 0
3072
+ },
3073
+ offset: {},
3074
+ orientation: {},
3075
+ position: {},
3076
+ rotate: {},
3077
+ scale: {},
3078
+ visible: {
3079
+ type: Boolean,
3080
+ default: void 0
3081
+ },
3082
+ content: {},
3083
+ size: {},
3084
+ zIndex: {},
3085
+ zooms: {}
3086
+ },
3087
+ emits: [
3088
+ "click",
3089
+ "dblClick",
3090
+ "rightClick",
3091
+ "dragStart",
3092
+ "dragging",
3093
+ "dragEnd",
3094
+ "mouseDown",
3095
+ "mouseUp",
3096
+ "mouseOver",
3097
+ "mouseOut",
3098
+ "mouseMove",
3099
+ "moveStart",
3100
+ "moveAlong",
3101
+ "moveEnd",
3102
+ "moving",
3103
+ "touchStart",
3104
+ "touchMove",
3105
+ "touchEnd"
3106
+ ],
3107
+ setup(__props, { expose: __expose, emit: __emit }) {
3108
+ const props = __props;
3109
+ const emits = __emit;
3110
+ const elasticMarkerEvents = domOverlayEvents;
3111
+ const map = useMapInstance(props);
3112
+ const restProps = shallowReactiveOmit(props, "map");
3113
+ const elasticMarker = shallowRef(new AMap.ElasticMarker(toDefinedRaw(restProps)));
3114
+ watchEffect((onCleanup) => {
3115
+ map.value?.add(elasticMarker.value);
3116
+ onCleanup(() => {
3117
+ map.value?.remove(elasticMarker.value);
3118
+ });
3119
+ });
3120
+ useMarkerAttributes(elasticMarker, shallowReactiveOmit(props, [
3121
+ "map",
3122
+ "styles",
3123
+ "zoomStyleMapping"
3124
+ ]));
3125
+ watch(() => props.zoomStyleMapping, (val) => {
3126
+ if (val !== void 0) elasticMarker.value.setMapping(clone(toRaw(val)));
3127
+ });
3128
+ watch(() => props.styles, (val) => {
3129
+ if (val !== void 0) elasticMarker.value.setStyle(clone(toRaw(val)));
3130
+ });
3131
+ use_event_listeners_default(elasticMarker, emits, elasticMarkerEvents);
3132
+ onUnmounted(() => elasticMarker.value.destroy());
3133
+ __expose({ instance: elasticMarker });
3134
+ return (_ctx, _cache) => {
3135
+ return null;
3136
+ };
3137
+ }
3138
+ });
3139
+ // src/overlay/ellipse/ellipse.vue
3140
+ var ellipse_default = /* @__PURE__ */ defineComponent({
3141
+ name: "AMap.Ellipse",
3142
+ inheritAttrs: false,
3143
+ __name: "ellipse",
3144
+ props: {
3145
+ map: {},
3146
+ visible: {
3147
+ type: Boolean,
3148
+ default: void 0
3149
+ },
3150
+ center: {},
3151
+ height: {},
3152
+ radius: {},
3153
+ async: {
3154
+ type: Boolean,
3155
+ default: void 0
3156
+ },
3157
+ bubble: {
3158
+ type: Boolean,
3159
+ default: void 0
3160
+ },
3161
+ extrusionHeight: {},
3162
+ fillColor: {},
3163
+ fillOpacity: {},
3164
+ innerOverlay: {
3165
+ type: Boolean,
3166
+ default: void 0
3167
+ },
3168
+ noSelect: {
3169
+ type: Boolean,
3170
+ default: void 0
3171
+ },
3172
+ cursor: {},
3173
+ draggable: {
3174
+ type: Boolean,
3175
+ default: void 0
3176
+ },
3177
+ extData: {},
3178
+ strokeColor: {},
3179
+ strokeDasharray: {},
3180
+ strokeOpacity: {},
3181
+ strokeStyle: {},
3182
+ strokeWeight: {},
3183
+ zIndex: {},
3184
+ zooms: {}
3185
+ },
3186
+ emits: [
3187
+ "hide",
3188
+ "show",
3189
+ "click",
3190
+ "dblClick",
3191
+ "rightClick",
3192
+ "mouseDown",
3193
+ "mouseUp",
3194
+ "mouseOver",
3195
+ "mouseOut",
3196
+ "dragStart",
3197
+ "dragging",
3198
+ "dragEnd",
3199
+ "touchStart",
3200
+ "touchMove",
3201
+ "touchEnd"
3202
+ ],
3203
+ setup(__props, { expose: __expose, emit: __emit }) {
3204
+ const props = __props;
3205
+ const emits = __emit;
3206
+ const ellipseEvents = vectorOverlayEvents;
3207
+ const map = useMapInstance(props);
3208
+ const restProps = shallowReactiveOmit(props, "map");
3209
+ const vectorLayer = useVectorLayerInstance();
3210
+ const ellipse = shallowRef(new AMap.Ellipse(toDefinedRaw(restProps)));
3211
+ watchEffect((onCleanup) => {
3212
+ if (vectorLayer) vectorLayer.value.add(ellipse.value);
3213
+ else map.value?.add(ellipse.value);
3214
+ onCleanup(() => {
3215
+ if (vectorLayer) vectorLayer.value.remove(ellipse.value);
3216
+ else map.value?.remove(ellipse.value);
3217
+ });
3218
+ });
3219
+ useVectorOverlayAttributes(ellipse, props);
3220
+ watch(() => props.center, (val) => {
3221
+ if (val !== void 0) ellipse.value.setCenter(toRaw(val));
3222
+ });
3223
+ watch(() => props.radius, (val) => {
3224
+ if (val !== void 0) ellipse.value.setRadius(val);
3225
+ });
3226
+ watch(shallowReactiveOmit(props, [
3227
+ "map",
3228
+ "draggable",
3229
+ "extData",
3230
+ "visible",
3231
+ "center",
3232
+ "radius"
3233
+ ]), (val) => {
3234
+ ellipse.value.setOptions(toDefinedRaw(val));
3235
+ });
3236
+ use_event_listeners_default(ellipse, emits, ellipseEvents);
3237
+ onUnmounted(() => ellipse.value.destroy());
3238
+ __expose({ instance: ellipse });
3239
+ return (_ctx, _cache) => {
3240
+ return null;
3241
+ };
3242
+ }
3243
+ });
3244
+ // src/overlay/index-cluster/index-cluster.vue
3245
+ var index_cluster_default = /* @__PURE__ */ defineComponent({
3246
+ name: "AMap.IndexCluster",
3247
+ inheritAttrs: false,
3248
+ __name: "index-cluster",
3249
+ props: {
3250
+ data: {},
3251
+ map: {},
3252
+ gridSize: {},
3253
+ minClusterSize: {},
3254
+ maxZoom: {},
3255
+ averageCenter: {
3256
+ type: Boolean,
3257
+ default: void 0
3258
+ },
3259
+ clusterByZoomChange: {
3260
+ type: Boolean,
3261
+ default: void 0
3262
+ },
3263
+ styles: {},
3264
+ renderMarker: {},
3265
+ renderClusterMarker: {},
3266
+ customRender: {},
3267
+ clusterIndexSet: {}
3268
+ },
3269
+ emits: ["click"],
3270
+ setup(__props, { expose: __expose, emit: __emit }) {
3271
+ const props = __props;
3272
+ const emits = __emit;
3273
+ const indexClusterEvents = [click];
3274
+ const map = useMapInstance(props);
3275
+ const restProps = shallowReactiveOmit(props, "map", "data");
3276
+ const indexCluster = shallowRef(new AMap.IndexCluster(null, clone(toRaw(props.data), true), toDefinedRaw(restProps)));
3277
+ watchEffect((onCleanup) => {
3278
+ indexCluster.value.i = null;
3279
+ indexCluster.value.setMap(map.value);
3280
+ onCleanup(() => {
3281
+ indexCluster.value.setMap(null);
3282
+ });
3283
+ });
3284
+ watchEffect((onCleanup) => {
3285
+ indexCluster.value.setData(clone(toRaw(props.data), true));
3286
+ onCleanup(() => {
3287
+ indexCluster.value.setData([]);
3288
+ });
3289
+ });
3290
+ function getDefaultStyles() {
3291
+ const instance = new AMap.IndexCluster();
3292
+ const styles = instance.getStyles();
3293
+ instance.setMap(null);
3294
+ return styles;
3295
+ }
3296
+ watch(() => props.averageCenter, (val) => {
3297
+ if (val !== void 0) indexCluster.value.setAverageCenter(val);
3298
+ });
3299
+ watch(() => props.clusterByZoomChange, (val) => {
3300
+ indexCluster.value.clusterByZoomChange = val || false;
3301
+ });
3302
+ watch(() => props.customRender, (val) => {
3303
+ indexCluster.value.customRender = val || null;
3304
+ });
3305
+ watch(() => props.gridSize, (val) => {
3306
+ if (val !== void 0) indexCluster.value.setGridSize(val);
3307
+ });
3308
+ watch(() => props.maxZoom, (val) => {
3309
+ if (val !== void 0) indexCluster.value.setMaxZoom(val);
3310
+ });
3311
+ watch(() => props.renderClusterMarker, (val) => {
3312
+ indexCluster.value.renderClusterMarker = val || null;
3313
+ });
3314
+ watch(() => props.renderMarker, (val) => {
3315
+ indexCluster.value.setRenderMarkerStyle(val || null);
3316
+ });
3317
+ watch(() => props.styles, (val) => {
3318
+ indexCluster.value.setStyles(val ?? getDefaultStyles());
3319
+ });
3320
+ use_event_listeners_default(indexCluster, emits, indexClusterEvents);
3321
+ __expose({ instance: indexCluster });
3322
+ return (_ctx, _cache) => {
3323
+ return null;
3324
+ };
3325
+ }
3326
+ });
3327
+ // src/overlay/info-window/info-window.vue
3328
+ var info_window_default = /* @__PURE__ */ defineComponent({
3329
+ name: "AMap.InfoWindow",
3330
+ inheritAttrs: false,
3331
+ __name: "info-window",
3332
+ props: {
3333
+ autoMove: {
3334
+ type: Boolean,
3335
+ default: void 0
3336
+ },
3337
+ avoid: {},
3338
+ closeWhenClickMap: {
3339
+ type: Boolean,
3340
+ default: void 0
3341
+ },
3342
+ content: {},
3343
+ extData: {},
3344
+ isCustom: {
3345
+ type: Boolean,
3346
+ default: void 0
3347
+ },
3348
+ anchor: {},
3349
+ innerOverlay: {
3350
+ type: Boolean,
3351
+ default: void 0
3352
+ },
3353
+ map: {},
3354
+ noSelect: {
3355
+ type: Boolean,
3356
+ default: void 0
3357
+ },
3358
+ offset: {},
3359
+ orientation: {},
3360
+ position: {},
3361
+ rotate: {},
3362
+ scale: {},
3363
+ visible: {
3364
+ type: Boolean,
3365
+ default: void 0
3366
+ },
3367
+ size: {},
3368
+ zIndex: {},
3369
+ zooms: {}
3370
+ },
3371
+ emits: ["close", "open"],
3372
+ setup(__props, { expose: __expose, emit: __emit }) {
3373
+ const props = __props;
3374
+ const emits = __emit;
3375
+ const infoWindowEvents = [close, open];
3376
+ const map = useMapInstance(props);
3377
+ const restProps = shallowReactiveOmit(props, "map");
3378
+ const infoWindow = shallowRef(new AMap.InfoWindow(toDefinedRaw(restProps)));
3379
+ watchEffect((onCleanup) => {
3380
+ map.value?.add(infoWindow.value);
3381
+ onCleanup(() => {
3382
+ map.value?.remove(infoWindow.value);
3383
+ });
3384
+ });
3385
+ const slots = useSlots();
3386
+ const hasChildren = computed(() => slots.default !== void 0);
3387
+ watch(() => props.extData, (val) => {
3388
+ infoWindow.value.setExtData(toRaw(val));
3389
+ });
3390
+ watch(shallowReactiveOmit(props, [
3391
+ "map",
3392
+ "anchor",
3393
+ "content",
3394
+ "offset",
3395
+ "orientation",
3396
+ "position",
3397
+ "rotate",
3398
+ "size",
3399
+ "visible",
3400
+ "zIndex",
3401
+ "extData"
3402
+ ]), (val) => {
3403
+ infoWindow.value.setOptions(toDefinedRaw(val));
3404
+ });
3405
+ useDOMOverlayAttributes(infoWindow, props, hasChildren);
3406
+ use_event_listeners_default(infoWindow, emits, infoWindowEvents);
3407
+ onUnmounted(() => infoWindow.value.destroy());
3408
+ __expose({ instance: infoWindow });
3409
+ return (_ctx, _cache) => {
3410
+ return _ctx.$slots.default ? (openBlock(), createBlock(unref(custom_content_default), {
3411
+ key: 0,
3412
+ instance: infoWindow.value
3413
+ }, {
3414
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3415
+ _: 3
3416
+ }, 8, ["instance"])) : createCommentVNode("v-if", true);
3417
+ };
3418
+ }
3419
+ });
3420
+ // src/overlay/label-marker/label-marker.vue
3421
+ var label_marker_default = /* @__PURE__ */ defineComponent({
3422
+ name: "AMap.LabelMarker",
3423
+ inheritAttrs: false,
3424
+ __name: "label-marker",
3425
+ props: {
3426
+ isTop: {
3427
+ type: Boolean,
3428
+ default: void 0
3429
+ },
3430
+ bubble: {
3431
+ type: Boolean,
3432
+ default: void 0
3433
+ },
3434
+ cursor: {},
3435
+ draggable: {
3436
+ type: Boolean,
3437
+ default: void 0
3438
+ },
3439
+ extData: {},
3440
+ icon: {},
3441
+ innerOverlay: {
3442
+ type: Boolean,
3443
+ default: void 0
3444
+ },
3445
+ name: {},
3446
+ noSelect: {
3447
+ type: Boolean,
3448
+ default: void 0
3449
+ },
3450
+ opacity: {},
3451
+ orientation: {},
3452
+ position: {},
3453
+ rank: {},
3454
+ richText: {},
3455
+ rotation: {},
3456
+ text: {},
3457
+ visible: {
3458
+ type: Boolean,
3459
+ default: void 0
3460
+ },
3461
+ zIndex: {},
3462
+ zooms: {}
3463
+ },
3464
+ emits: [
3465
+ "click",
3466
+ "mouseDown",
3467
+ "mouseUp",
3468
+ "mouseOver",
3469
+ "mouseOut",
3470
+ "mouseMove",
3471
+ "touchStart",
3472
+ "touchMove",
3473
+ "touchEnd"
3474
+ ],
3475
+ setup(__props, { expose: __expose, emit: __emit }) {
3476
+ const props = __props;
3477
+ const emits = __emit;
3478
+ const labelMarkerEvents = [
3479
+ click,
3480
+ mouseMove,
3481
+ mouseOver,
3482
+ mouseOut,
3483
+ mouseUp,
3484
+ touchStart,
3485
+ touchMove,
3486
+ touchEnd
3487
+ ];
3488
+ const labelsLayer = useLabelsLayerInstance();
3489
+ const labelMarker = shallowRef(new AMap.LabelMarker(toDefinedRaw(props)));
3490
+ watchEffect((onCleanup) => {
3491
+ labelsLayer?.value?.add(labelMarker.value);
3492
+ onCleanup(() => {
3493
+ labelsLayer?.value?.remove(labelMarker.value);
3494
+ });
3495
+ });
3496
+ watch(() => props.cursor, (val) => {
3497
+ labelMarker.value.setCursor(val);
3498
+ });
3499
+ watch(() => props.extData, (val) => {
3500
+ labelMarker.value.setExtData(toRaw(val));
3501
+ });
3502
+ watch(() => props.icon, (val) => {
3503
+ labelMarker.value.setIcon(clone(toRaw(val)));
3504
+ });
3505
+ watch(() => props.name, (val) => {
3506
+ if (val !== void 0) labelMarker.value.setName(val);
3507
+ });
3508
+ watch(() => props.opacity, (val) => {
3509
+ labelMarker.value.setOpacity(val);
3510
+ });
3511
+ watch(() => props.orientation, (val) => {
3512
+ labelMarker.value.setOrientation(val);
3513
+ });
3514
+ watch(() => props.position, (val) => {
3515
+ if (val !== void 0) labelMarker.value.setPosition(clone(toRaw(val)));
3516
+ });
3517
+ watch(() => props.rank, (val) => {
3518
+ if (val !== void 0) labelMarker.value.setRank(val);
3519
+ });
3520
+ watch(() => props.richText, (val) => {
3521
+ labelMarker.value.setRichText(clone(toRaw(val)));
3522
+ });
3523
+ watch(() => props.rotation, (val) => {
3524
+ if (val !== void 0) labelMarker.value.setRotation(val);
3525
+ });
3526
+ watch(() => props.text, (val) => {
3527
+ if (val !== void 0) labelMarker.value.setText(clone(toRaw(val)));
3528
+ });
3529
+ watch(() => props.isTop, (val) => {
3530
+ labelMarker.value.setTop(val);
3531
+ });
3532
+ watch(() => props.visible, (val) => {
3533
+ labelMarker.value.setVisible(val);
3534
+ });
3535
+ watch(() => props.zooms, (val) => {
3536
+ labelMarker.value.setZooms(clone(toRaw(val)));
3537
+ });
3538
+ watch(() => props.zIndex, (val) => {
3539
+ if (val !== void 0) labelMarker.value.setzIndex(val);
3540
+ });
3541
+ use_event_listeners_default(labelMarker, emits, labelMarkerEvents);
3542
+ __expose({ instance: labelMarker });
3543
+ return (_ctx, _cache) => {
3544
+ return null;
3545
+ };
3546
+ }
3547
+ });
3548
+ // src/overlay/marker-cluster/marker-cluster.vue
3549
+ var marker_cluster_default = /* @__PURE__ */ defineComponent({
3550
+ name: "AMap.MarkerCluster",
3551
+ inheritAttrs: false,
3552
+ __name: "marker-cluster",
3553
+ props: {
3554
+ data: {},
3555
+ map: {},
3556
+ gridSize: {},
3557
+ minClusterSize: {},
3558
+ maxZoom: {},
3559
+ averageCenter: {
3560
+ type: Boolean,
3561
+ default: void 0
3562
+ },
3563
+ clusterByZoomChange: {
3564
+ type: Boolean,
3565
+ default: void 0
3566
+ },
3567
+ styles: {},
3568
+ renderMarker: {},
3569
+ renderClusterMarker: {}
3570
+ },
3571
+ emits: ["click"],
3572
+ setup(__props, { expose: __expose, emit: __emit }) {
3573
+ const props = __props;
3574
+ const emits = __emit;
3575
+ const markerClusterEvents = [click];
3576
+ const map = useMapInstance(props);
3577
+ const restProps = shallowReactiveOmit(props, "map", "data");
3578
+ const markerCluster = shallowRef(new AMap.MarkerCluster(null, clone(toRaw(props.data), true), toDefinedRaw(restProps)));
3579
+ watchEffect((onCleanup) => {
3580
+ markerCluster.value.i = null;
3581
+ markerCluster.value.setMap(map.value);
3582
+ onCleanup(() => {
3583
+ markerCluster.value.setMap(null);
3584
+ });
3585
+ });
3586
+ watchEffect((onCleanup) => {
3587
+ markerCluster.value.setData(clone(toRaw(props.data), true));
3588
+ onCleanup(() => {
3589
+ markerCluster.value.setData([]);
3590
+ });
3591
+ });
3592
+ function getDefaultStyles() {
3593
+ const instance = new AMap.MarkerCluster();
3594
+ const styles = instance.getStyles();
3595
+ instance.setMap(null);
3596
+ return styles;
3597
+ }
3598
+ watch(() => props.averageCenter, (val) => {
3599
+ if (val !== void 0) markerCluster.value.setAverageCenter(val);
3600
+ });
3601
+ watch(() => props.gridSize, (val) => {
3602
+ if (val !== void 0) markerCluster.value.setGridSize(val);
3603
+ });
3604
+ watch(() => props.maxZoom, (val) => {
3605
+ if (val !== void 0) markerCluster.value.setMaxZoom(val);
3606
+ });
3607
+ watch(() => props.minClusterSize, (val) => {
3608
+ if (val !== void 0) markerCluster.value.setMinClusterSize(val);
3609
+ });
3610
+ watch(() => props.renderClusterMarker, (val) => {
3611
+ markerCluster.value.renderClusterMarker = val;
3612
+ });
3613
+ watch(() => props.renderMarker, (val) => {
3614
+ markerCluster.value.setRenderMarkerStyle(val);
3615
+ });
3616
+ watch(() => props.styles, (val) => {
3617
+ markerCluster.value.setStyles(val ?? getDefaultStyles());
3618
+ });
3619
+ use_event_listeners_default(markerCluster, emits, markerClusterEvents);
3620
+ __expose({ instance: markerCluster });
3621
+ return (_ctx, _cache) => {
3622
+ return null;
3623
+ };
3624
+ }
3625
+ });
3626
+ // src/overlay/mass-marks/mass-marks.vue
3627
+ var mass_marks_default = /* @__PURE__ */ defineComponent({
3628
+ name: "AMap.MassMarks",
3629
+ inheritAttrs: false,
3630
+ __name: "mass-marks",
3631
+ props: {
3632
+ data: {},
3633
+ map: {},
3634
+ styles: {},
3635
+ style: {},
3636
+ zIndex: {},
3637
+ opacity: {},
3638
+ zooms: {},
3639
+ cursor: {}
3640
+ },
3641
+ emits: [
3642
+ "click",
3643
+ "complete",
3644
+ "dblClick",
3645
+ "mouseDown",
3646
+ "mouseMove",
3647
+ "mouseOut",
3648
+ "mouseOver",
3649
+ "mouseUp",
3650
+ "touchEnd",
3651
+ "touchStart"
3652
+ ],
3653
+ setup(__props, { expose: __expose, emit: __emit }) {
3654
+ const props = __props;
3655
+ const emits = __emit;
3656
+ const massMarksEvents = [
3657
+ click,
3658
+ complete,
3659
+ dblClick,
3660
+ mouseDown,
3661
+ mouseMove,
3662
+ mouseOut,
3663
+ mouseOver,
3664
+ mouseUp,
3665
+ touchEnd,
3666
+ touchStart
3667
+ ];
3668
+ const map = useMapInstance(props);
3669
+ const restProps = shallowReactiveOmit(props, "map", "data");
3670
+ const { styles, ...options } = toDefinedRaw(restProps);
3671
+ const massMarks = shallowRef(new AMap.MassMarks(clone(toRaw(props.data)), {
3672
+ ...options,
3673
+ style: clone(toRaw(styles))
3674
+ }));
3675
+ watchEffect((onCleanup) => {
3676
+ massMarks.value.setMap(map.value);
3677
+ onCleanup(() => {
3678
+ massMarks.value.setMap(null);
3679
+ });
3680
+ });
3681
+ watchEffect(() => {
3682
+ massMarks.value.setData(clone(toRaw(props.data)));
3683
+ });
3684
+ watch(() => props.opacity, (val) => {
3685
+ if (val !== void 0) massMarks.value.setOpacity(val);
3686
+ });
3687
+ watch(() => props.styles, (val) => {
3688
+ if (val !== void 0) massMarks.value.setStyle(clone(toRaw(val)));
3689
+ });
3690
+ watch(() => props.zIndex, (val) => {
3691
+ if (val !== void 0) massMarks.value.setzIndex(val);
3692
+ });
3693
+ watch(() => props.zooms, (val) => {
3694
+ if (val !== void 0) massMarks.value.setZooms(clone(toRaw(val)));
3695
+ });
3696
+ use_event_listeners_default(massMarks, emits, massMarksEvents);
3697
+ onUnmounted(() => massMarks.value.clear());
3698
+ __expose({ instance: massMarks });
3699
+ return (_ctx, _cache) => {
3700
+ return null;
3701
+ };
3702
+ }
3703
+ });
3704
+ // src/overlay/overlay-group/overlay-group.vue
3705
+ var overlay_group_default = /* @__PURE__ */ defineComponent({
3706
+ name: "AMap.OverlayGroup",
3707
+ inheritAttrs: false,
3708
+ __name: "overlay-group",
3709
+ props: {
3710
+ map: {},
3711
+ visible: {
3712
+ type: Boolean,
3713
+ default: void 0
3714
+ },
3715
+ overlays: { default: () => [] }
3716
+ },
3717
+ emits: [
3718
+ "hide",
3719
+ "show",
3720
+ "click",
3721
+ "dblClick",
3722
+ "rightClick",
3723
+ "mouseDown",
3724
+ "mouseUp",
3725
+ "mouseOver",
3726
+ "mouseOut",
3727
+ "mouseMove",
3728
+ "moveStart",
3729
+ "moveAlong",
3730
+ "moveEnd",
3731
+ "moving",
3732
+ "dragStart",
3733
+ "dragging",
3734
+ "dragEnd",
3735
+ "touchStart",
3736
+ "touchMove",
3737
+ "touchEnd"
3738
+ ],
3739
+ setup(__props, { expose: __expose, emit: __emit }) {
3740
+ const props = __props;
3741
+ const emits = __emit;
3742
+ const map = useMapInstance(props);
3743
+ const overlayGroup = shallowRef(new AMap.OverlayGroup());
3744
+ watch(() => [...props.overlays], (newOverlays) => {
3745
+ const current = new Set(overlayGroup.value.getOverlays());
3746
+ const next = new Set(newOverlays);
3747
+ const toRemove = [...current].filter((o) => !next.has(o));
3748
+ const toAdd = [...next].filter((o) => !current.has(o));
3749
+ if (toRemove.length) overlayGroup.value.removeOverlays(toRemove);
3750
+ if (toAdd.length) overlayGroup.value.addOverlays(toAdd);
3751
+ }, {
3752
+ deep: true,
3753
+ immediate: true
3754
+ });
3755
+ const boundMap = /* @__PURE__ */ new Map();
3756
+ watch(() => [...props.overlays], (newOverlays) => {
3757
+ const nextOverlays = newOverlays ? [...new Set(newOverlays)] : [];
3758
+ const nextSet = new Set(nextOverlays);
3759
+ for (const [overlay, handlerMap] of boundMap) if (!nextSet.has(overlay)) {
3760
+ for (const [eventType, handler] of handlerMap) overlay.off(lowercase(eventType), handler);
3761
+ boundMap.delete(overlay);
3762
+ if ("destroy" in overlay && typeof overlay.destroy === "function") overlay.destroy();
3763
+ }
3764
+ for (const overlay of nextOverlays) {
3765
+ if (boundMap.has(overlay)) continue;
3766
+ const eventTypes = overlay instanceof AMap.Marker ? domOverlayEvents : vectorOverlayEvents;
3767
+ const handlerMap = /* @__PURE__ */ new Map();
3768
+ for (const eventType of eventTypes) {
3769
+ const handler = (event) => {
3770
+ emits(eventType, event);
3771
+ };
3772
+ overlay.on(lowercase(eventType), handler);
3773
+ handlerMap.set(eventType, handler);
3774
+ }
3775
+ boundMap.set(overlay, handlerMap);
3776
+ }
3777
+ }, {
3778
+ deep: true,
3779
+ immediate: true
3780
+ });
3781
+ watchEffect((onCleanup) => {
3782
+ map.value?.add(overlayGroup.value);
3783
+ onCleanup(() => {
3784
+ map.value?.remove(overlayGroup.value);
3785
+ });
3786
+ });
3787
+ watch(() => props.visible, (val) => {
3788
+ if (val !== void 0) {
3789
+ if (val) overlayGroup.value.show();
3790
+ else overlayGroup.value.hide();
3791
+ }
3792
+ });
3793
+ __expose({ instance: overlayGroup });
3794
+ function dispose() {
3795
+ for (const [overlay, handlerMap] of boundMap) {
3796
+ for (const [eventType, handler] of handlerMap) overlay.off(lowercase(eventType), handler);
3797
+ if ("destroy" in overlay && typeof overlay.destroy === "function") overlay.destroy();
3798
+ }
3799
+ boundMap.clear();
3800
+ }
3801
+ onUnmounted(() => {
3802
+ dispose();
3803
+ overlayGroup.value.clearOverlays();
3804
+ });
3805
+ return (_ctx, _cache) => {
3806
+ return null;
3807
+ };
3808
+ }
3809
+ });
3810
+ // src/overlay/polygon/polygon.vue
3811
+ var polygon_default = /* @__PURE__ */ defineComponent({
3812
+ name: "AMap.Polygon",
3813
+ inheritAttrs: false,
3814
+ __name: "polygon",
3815
+ props: {
3816
+ map: {},
3817
+ visible: {
3818
+ type: Boolean,
3819
+ default: void 0
3820
+ },
3821
+ path: {},
3822
+ roofColor: {},
3823
+ wallColor: {},
3824
+ async: {
3825
+ type: Boolean,
3826
+ default: void 0
3827
+ },
3828
+ bubble: {
3829
+ type: Boolean,
3830
+ default: void 0
3831
+ },
3832
+ extrusionHeight: {},
3833
+ fillColor: {},
3834
+ fillOpacity: {},
3835
+ innerOverlay: {
3836
+ type: Boolean,
3837
+ default: void 0
3838
+ },
3839
+ noSelect: {
3840
+ type: Boolean,
3841
+ default: void 0
3842
+ },
3843
+ cursor: {},
3844
+ draggable: {
3845
+ type: Boolean,
3846
+ default: void 0
3847
+ },
3848
+ extData: {},
3849
+ strokeColor: {},
3850
+ strokeDasharray: {},
3851
+ strokeOpacity: {},
3852
+ strokeStyle: {},
3853
+ strokeWeight: {},
3854
+ zIndex: {},
3855
+ zooms: {}
3856
+ },
3857
+ emits: [
3858
+ "hide",
3859
+ "show",
3860
+ "click",
3861
+ "dblClick",
3862
+ "rightClick",
3863
+ "mouseDown",
3864
+ "mouseUp",
3865
+ "mouseOver",
3866
+ "mouseOut",
3867
+ "dragStart",
3868
+ "dragging",
3869
+ "dragEnd",
3870
+ "touchStart",
3871
+ "touchMove",
3872
+ "touchEnd"
3873
+ ],
3874
+ setup(__props, { expose: __expose, emit: __emit }) {
3875
+ const props = __props;
3876
+ const emits = __emit;
3877
+ const polygonEvents = vectorOverlayEvents;
3878
+ const map = useMapInstance(props);
3879
+ const restProps = shallowReactiveOmit(props, "map");
3880
+ const vectorLayer = useVectorLayerInstance();
3881
+ const polygon = shallowRef(new AMap.Polygon(toDefinedRaw(restProps)));
3882
+ watchEffect((onCleanup) => {
3883
+ if (vectorLayer) vectorLayer.value.add(polygon.value);
3884
+ else map.value?.add(polygon.value);
3885
+ onCleanup(() => {
3886
+ if (vectorLayer) vectorLayer.value.remove(polygon.value);
3887
+ else map.value?.remove(polygon.value);
3888
+ });
3889
+ });
3890
+ useVectorOverlayAttributes(polygon, props);
3891
+ watch(() => props.path, (val) => {
3892
+ polygon.value.setPath(toRaw(val));
3893
+ });
3894
+ watch(() => props.extrusionHeight, (val) => {
3895
+ if (val !== void 0) polygon.value.setExtrusionHeight(toRaw(val));
3896
+ });
3897
+ watch(shallowReactiveOmit(props, [
3898
+ "map",
3899
+ "draggable",
3900
+ "extData",
3901
+ "visible",
3902
+ "extrusionHeight",
3903
+ "path"
3904
+ ]), (val) => {
3905
+ polygon.value.setOptions(toDefinedRaw(val));
3906
+ });
3907
+ use_event_listeners_default(polygon, emits, polygonEvents);
3908
+ onUnmounted(() => polygon.value.destroy());
3909
+ __expose({ instance: polygon });
3910
+ return (_ctx, _cache) => {
3911
+ return null;
3912
+ };
3913
+ }
3914
+ });
3915
+ // src/overlay/polyline/polyline.vue
3916
+ var polyline_default = /* @__PURE__ */ defineComponent({
3917
+ name: "AMap.Polyline",
3918
+ inheritAttrs: false,
3919
+ __name: "polyline",
3920
+ props: {
3921
+ map: {},
3922
+ visible: {
3923
+ type: Boolean,
3924
+ default: void 0
3925
+ },
3926
+ animate: {
3927
+ type: Boolean,
3928
+ default: void 0
3929
+ },
3930
+ dirImgGap: {},
3931
+ path: {},
3932
+ speed: {},
3933
+ borderWeight: {},
3934
+ dirColor: {},
3935
+ dirImg: {},
3936
+ geodesic: {
3937
+ type: Boolean,
3938
+ default: void 0
3939
+ },
3940
+ height: {},
3941
+ isOutLine: {
3942
+ type: Boolean,
3943
+ default: void 0
3944
+ },
3945
+ lineCap: {},
3946
+ lineGradient: {},
3947
+ lineJoin: {},
3948
+ outlineColor: {},
3949
+ showDir: {
3950
+ type: Boolean,
3951
+ default: void 0
3952
+ },
3953
+ cursor: {},
3954
+ draggable: {
3955
+ type: Boolean,
3956
+ default: void 0
3957
+ },
3958
+ extData: {},
3959
+ strokeColor: {},
3960
+ strokeDasharray: {},
3961
+ strokeOpacity: {},
3962
+ strokeStyle: {},
3963
+ strokeWeight: {},
3964
+ zIndex: {},
3965
+ zooms: {}
3966
+ },
3967
+ emits: [
3968
+ "hide",
3969
+ "show",
3970
+ "click",
3971
+ "dblClick",
3972
+ "rightClick",
3973
+ "mouseDown",
3974
+ "mouseUp",
3975
+ "mouseOver",
3976
+ "mouseOut",
3977
+ "dragStart",
3978
+ "dragging",
3979
+ "dragEnd",
3980
+ "touchStart",
3981
+ "touchMove",
3982
+ "touchEnd"
3983
+ ],
3984
+ setup(__props, { expose: __expose, emit: __emit }) {
3985
+ const props = __props;
3986
+ const emits = __emit;
3987
+ const polylineEvents = vectorOverlayEvents;
3988
+ const map = useMapInstance(props);
3989
+ const restProps = shallowReactiveOmit(props, "map");
3990
+ const vectorLayer = useVectorLayerInstance();
3991
+ const polyline = shallowRef(new AMap.Polyline(toDefinedRaw(restProps)));
3992
+ watchEffect((onCleanup) => {
3993
+ if (vectorLayer) vectorLayer.value.add(polyline.value);
3994
+ else map.value?.add(polyline.value);
3995
+ onCleanup(() => {
3996
+ if (vectorLayer) vectorLayer.value.remove(polyline.value);
3997
+ else map.value?.remove(polyline.value);
3998
+ });
3999
+ });
4000
+ useVectorOverlayAttributes(polyline, props);
4001
+ watch(() => props.path, (val) => {
4002
+ polyline.value.setPath(toRaw(val));
4003
+ });
4004
+ watch(shallowReactiveOmit(props, [
4005
+ "map",
4006
+ "draggable",
4007
+ "extData",
4008
+ "visible",
4009
+ "height",
4010
+ "path"
4011
+ ]), (val) => {
4012
+ polyline.value.setOptions(toDefinedRaw(val));
4013
+ });
4014
+ use_event_listeners_default(polyline, emits, polylineEvents);
4015
+ onUnmounted(() => polyline.value.destroy());
4016
+ __expose({ instance: polyline });
4017
+ return (_ctx, _cache) => {
4018
+ return null;
4019
+ };
4020
+ }
4021
+ });
4022
+ // src/overlay/rectangle/rectangle.vue
4023
+ var rectangle_default = /* @__PURE__ */ defineComponent({
4024
+ name: "AMap.Rectangle",
4025
+ inheritAttrs: false,
4026
+ __name: "rectangle",
4027
+ props: {
4028
+ map: {},
4029
+ visible: {
4030
+ type: Boolean,
4031
+ default: void 0
4032
+ },
4033
+ bounds: {},
4034
+ async: {
4035
+ type: Boolean,
4036
+ default: void 0
4037
+ },
4038
+ bubble: {
4039
+ type: Boolean,
4040
+ default: void 0
4041
+ },
4042
+ extrusionHeight: {},
4043
+ fillColor: {},
4044
+ fillOpacity: {},
4045
+ innerOverlay: {
4046
+ type: Boolean,
4047
+ default: void 0
4048
+ },
4049
+ noSelect: {
4050
+ type: Boolean,
4051
+ default: void 0
4052
+ },
4053
+ cursor: {},
4054
+ draggable: {
4055
+ type: Boolean,
4056
+ default: void 0
4057
+ },
4058
+ extData: {},
4059
+ strokeColor: {},
4060
+ strokeDasharray: {},
4061
+ strokeOpacity: {},
4062
+ strokeStyle: {},
4063
+ strokeWeight: {},
4064
+ zIndex: {},
4065
+ zooms: {}
4066
+ },
4067
+ emits: [
4068
+ "hide",
4069
+ "show",
4070
+ "click",
4071
+ "dblClick",
4072
+ "rightClick",
4073
+ "mouseDown",
4074
+ "mouseUp",
4075
+ "mouseOver",
4076
+ "mouseOut",
4077
+ "dragStart",
4078
+ "dragging",
4079
+ "dragEnd",
4080
+ "touchStart",
4081
+ "touchMove",
4082
+ "touchEnd"
4083
+ ],
4084
+ setup(__props, { expose: __expose, emit: __emit }) {
4085
+ const props = __props;
4086
+ const emits = __emit;
4087
+ const rectangleEvents = vectorOverlayEvents;
4088
+ const map = useMapInstance(props);
4089
+ const restProps = shallowReactiveOmit(props, "map");
4090
+ const vectorLayer = useVectorLayerInstance();
4091
+ const rectangle = shallowRef(new AMap.Rectangle(toDefinedRaw(restProps)));
4092
+ watchEffect((onCleanup) => {
4093
+ if (vectorLayer) vectorLayer.value.add(rectangle.value);
4094
+ else map.value?.add(rectangle.value);
4095
+ onCleanup(() => {
4096
+ if (vectorLayer) vectorLayer.value.remove(rectangle.value);
4097
+ else map.value?.remove(rectangle.value);
4098
+ });
4099
+ });
4100
+ useVectorOverlayAttributes(rectangle, props);
4101
+ watch(() => props.bounds, (val) => {
4102
+ rectangle.value.setBounds(toRaw(val));
4103
+ });
4104
+ watch(shallowReactiveOmit(props, [
4105
+ "map",
4106
+ "draggable",
4107
+ "extData",
4108
+ "visible",
4109
+ "bounds"
4110
+ ]), (val) => {
4111
+ rectangle.value.setOptions(toDefinedRaw(val));
4112
+ });
4113
+ use_event_listeners_default(rectangle, emits, rectangleEvents);
4114
+ onUnmounted(() => rectangle.value.destroy());
4115
+ __expose({ instance: rectangle });
4116
+ return (_ctx, _cache) => {
4117
+ return null;
4118
+ };
4119
+ }
4120
+ });
4121
+ // src/overlay/text/text.vue
4122
+ var text_default = /* @__PURE__ */ defineComponent({
4123
+ name: "AMap.Text",
4124
+ inheritAttrs: false,
4125
+ __name: "text",
4126
+ props: {
4127
+ isTop: {
4128
+ type: Boolean,
4129
+ default: void 0
4130
+ },
4131
+ style: {},
4132
+ text: {},
4133
+ bubble: {
4134
+ type: Boolean,
4135
+ default: void 0
4136
+ },
4137
+ clickable: {
4138
+ type: Boolean,
4139
+ default: void 0
4140
+ },
4141
+ cursor: {},
4142
+ draggable: {
4143
+ type: Boolean,
4144
+ default: void 0
4145
+ },
4146
+ extData: {},
4147
+ icon: {},
4148
+ title: {},
4149
+ topWhenClick: {
4150
+ type: Boolean,
4151
+ default: void 0
4152
+ },
4153
+ label: {},
4154
+ anchor: {},
4155
+ innerOverlay: {
4156
+ type: Boolean,
4157
+ default: void 0
4158
+ },
4159
+ isCustom: {
4160
+ type: Boolean,
4161
+ default: void 0
4162
+ },
4163
+ map: {},
4164
+ noSelect: {
4165
+ type: Boolean,
4166
+ default: void 0
4167
+ },
4168
+ offset: {},
4169
+ orientation: {},
4170
+ position: {},
4171
+ rotate: {},
4172
+ scale: {},
4173
+ visible: {
4174
+ type: Boolean,
4175
+ default: void 0
4176
+ },
4177
+ content: {},
4178
+ size: {},
4179
+ zIndex: {},
4180
+ zooms: {}
4181
+ },
4182
+ emits: [
4183
+ "click",
4184
+ "dblClick",
4185
+ "rightClick",
4186
+ "dragStart",
4187
+ "dragging",
4188
+ "dragEnd",
4189
+ "mouseDown",
4190
+ "mouseUp",
4191
+ "mouseOver",
4192
+ "mouseOut",
4193
+ "mouseMove",
4194
+ "moveStart",
4195
+ "moveAlong",
4196
+ "moveEnd",
4197
+ "moving",
4198
+ "touchStart",
4199
+ "touchMove",
4200
+ "touchEnd"
4201
+ ],
4202
+ setup(__props, { expose: __expose, emit: __emit }) {
4203
+ const props = __props;
4204
+ const emits = __emit;
4205
+ const textEvents = domOverlayEvents;
4206
+ const map = useMapInstance(props);
4207
+ const restProps = shallowReactiveOmit(props, "map");
4208
+ const text = shallowRef(new AMap.Text(toDefinedRaw(restProps)));
4209
+ watchEffect((onCleanup) => {
4210
+ map.value?.add(text.value);
4211
+ onCleanup(() => {
4212
+ map.value?.remove(text.value);
4213
+ });
4214
+ });
4215
+ const slots = useSlots();
4216
+ const hasChildren = computed(() => slots.default !== void 0);
4217
+ useMarkerAttributes(text, shallowReactiveOmit(props, [
4218
+ "map",
4219
+ "style",
4220
+ "text"
4221
+ ]), hasChildren);
4222
+ watch(() => props.style, (val) => {
4223
+ if (val !== void 0) text.value.setStyle(clone(toRaw(val)));
4224
+ });
4225
+ watch([
4226
+ hasChildren,
4227
+ () => props.content,
4228
+ () => props.text
4229
+ ], ([c1, c2, t1]) => {
4230
+ if (c1) return;
4231
+ if (c2 != null) text.value.setContent(c2);
4232
+ else if (t1 !== void 0) text.value.setText(clone(toRaw(t1)));
4233
+ }, { immediate: true });
4234
+ use_event_listeners_default(text, emits, textEvents);
4235
+ onUnmounted(() => text.value.destroy());
4236
+ __expose({ instance: text });
4237
+ return (_ctx, _cache) => {
4238
+ return _ctx.$slots.default ? (openBlock(), createBlock(unref(custom_content_default), {
4239
+ key: 0,
4240
+ instance: text.value
4241
+ }, {
4242
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
4243
+ _: 3
4244
+ }, 8, ["instance"])) : createCommentVNode("v-if", true);
4245
+ };
4246
+ }
4247
+ });
4248
+ // src/tool/bezier-curve-editor/bezier-curve-editor.vue
4249
+ var bezier_curve_editor_default = /* @__PURE__ */ defineComponent({
4250
+ name: "AMap.BezierCurveEditor",
4251
+ inheritAttrs: false,
4252
+ __name: "bezier-curve-editor",
4253
+ props: {
4254
+ map: {},
4255
+ target: {},
4256
+ createOptions: {},
4257
+ editOptions: {},
4258
+ controlPoint: {},
4259
+ midControlPoint: {},
4260
+ bezierControlPoint: {},
4261
+ bezierControlLine: {}
4262
+ },
4263
+ emits: [
4264
+ "add",
4265
+ "end",
4266
+ "addNode",
4267
+ "adjust",
4268
+ "removeNode"
4269
+ ],
4270
+ setup(__props, { expose: __expose, emit: __emit }) {
4271
+ const props = __props;
4272
+ const emits = __emit;
4273
+ const bezierCurveEditorEvents = [
4274
+ add,
4275
+ end,
4276
+ adjust,
4277
+ addNode,
4278
+ removeNode
4279
+ ];
4280
+ const map = useMapInstance(props);
4281
+ const restProps = shallowReactiveOmit(props, "map", "target");
4282
+ const bezierCurveEditor = shallowRef(map.value ? new AMap.BezierCurveEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4283
+ watchEffect((onCleanup) => {
4284
+ if (!bezierCurveEditor.value && map.value) bezierCurveEditor.value = new AMap.BezierCurveEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4285
+ onCleanup(() => {
4286
+ bezierCurveEditor.value?.destroy();
4287
+ });
4288
+ });
4289
+ watchEffect(() => {
4290
+ bezierCurveEditor.value?.setTarget(toValue(props.target));
4291
+ });
4292
+ watch([() => props.createOptions, bezierCurveEditor], ([val, editor]) => {
4293
+ if (val && editor) editor._normalPolylineStyle = AMap.extend(editor._normalPolylineStyle, clone(toRaw(val)));
4294
+ });
4295
+ watch([() => props.editOptions, bezierCurveEditor], ([val, editor]) => {
4296
+ if (val && editor) editor._editingPolylineStyle = AMap.extend(editor._editingPolylineStyle, clone(toRaw(val)));
4297
+ });
4298
+ watch([() => props.controlPoint, bezierCurveEditor], ([val, editor]) => {
4299
+ if (val && editor) editor.opts.controlPoint = toRaw(val);
4300
+ });
4301
+ watch([() => props.midControlPoint, bezierCurveEditor], ([val, editor]) => {
4302
+ if (val && editor) editor.opts.midControlPoint = toRaw(val);
4303
+ });
4304
+ watch([() => props.bezierControlPoint, bezierCurveEditor], ([val, editor]) => {
4305
+ if (val && editor) editor.opts.bezierControlPoint = toRaw(val);
4306
+ });
4307
+ watch([() => props.bezierControlLine, bezierCurveEditor], ([val, editor]) => {
4308
+ if (val && editor) editor.opts.bezierControlLine = AMap.extend(editor.opts.bezierControlLine, toRaw(val));
4309
+ });
4310
+ use_event_listeners_default(bezierCurveEditor, emits, bezierCurveEditorEvents);
4311
+ __expose({ instance: bezierCurveEditor });
4312
+ return (_ctx, _cache) => {
4313
+ return null;
4314
+ };
4315
+ }
4316
+ });
4317
+ // src/tool/circle-editor/circle-editor.vue
4318
+ var circle_editor_default = /* @__PURE__ */ defineComponent({
4319
+ name: "AMap.CircleEditor",
4320
+ inheritAttrs: false,
4321
+ __name: "circle-editor",
4322
+ props: {
4323
+ map: {},
4324
+ target: {},
4325
+ createOptions: {},
4326
+ editOptions: {},
4327
+ movePoint: {},
4328
+ resizePoint: {}
4329
+ },
4330
+ emits: [
4331
+ "add",
4332
+ "end",
4333
+ "adjust",
4334
+ "move"
4335
+ ],
4336
+ setup(__props, { expose: __expose, emit: __emit }) {
4337
+ const props = __props;
4338
+ const emits = __emit;
4339
+ const circleEditorEvents = [
4340
+ add,
4341
+ end,
4342
+ adjust,
4343
+ move
4344
+ ];
4345
+ const map = useMapInstance(props);
4346
+ const restProps = shallowReactiveOmit(props, "map", "target");
4347
+ const circleEditor = shallowRef(map.value ? new AMap.CircleEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4348
+ watchEffect((onCleanup) => {
4349
+ if (!circleEditor.value && map.value) circleEditor.value = new AMap.CircleEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4350
+ onCleanup(() => {
4351
+ circleEditor.value?.destroy();
4352
+ });
4353
+ });
4354
+ watchEffect(() => {
4355
+ circleEditor.value?.setTarget(toValue(props.target));
4356
+ });
4357
+ watch([() => props.createOptions, circleEditor], ([val, editor]) => {
4358
+ if (val && editor) editor._normalCircleStyle = AMap.extend(editor._normalCircleStyle, clone(toRaw(val)));
4359
+ });
4360
+ watch([() => props.editOptions, circleEditor], ([val, editor]) => {
4361
+ if (val && editor) editor._editStyle = AMap.extend(editor._editStyle, clone(toRaw(val)));
4362
+ });
4363
+ watch([() => props.movePoint, circleEditor], ([val, editor]) => {
4364
+ if (val && editor) editor._opts.movePoint = toRaw(val);
4365
+ });
4366
+ watch([() => props.resizePoint, circleEditor], ([val, editor]) => {
4367
+ if (val && editor) editor._opts.resizePoint = toRaw(val);
4368
+ });
4369
+ use_event_listeners_default(circleEditor, emits, circleEditorEvents);
4370
+ __expose({ instance: circleEditor });
4371
+ return (_ctx, _cache) => {
4372
+ return null;
4373
+ };
4374
+ }
4375
+ });
4376
+ // src/tool/ellipse-editor/ellipse-editor.vue
4377
+ var ellipse_editor_default = /* @__PURE__ */ defineComponent({
4378
+ name: "AMap.EllipseEditor",
4379
+ inheritAttrs: false,
4380
+ __name: "ellipse-editor",
4381
+ props: {
4382
+ map: {},
4383
+ target: {},
4384
+ createOptions: {},
4385
+ editOptions: {},
4386
+ movePoint: {},
4387
+ resizeXPoint: {},
4388
+ resizeYPoint: {}
4389
+ },
4390
+ emits: [
4391
+ "add",
4392
+ "end",
4393
+ "adjust",
4394
+ "move"
4395
+ ],
4396
+ setup(__props, { expose: __expose, emit: __emit }) {
4397
+ const props = __props;
4398
+ const emits = __emit;
4399
+ const ellipseEditorEvents = [
4400
+ add,
4401
+ end,
4402
+ adjust,
4403
+ move
4404
+ ];
4405
+ const map = useMapInstance(props);
4406
+ const restProps = shallowReactiveOmit(props, "map", "target");
4407
+ const ellipseEditor = shallowRef(map.value ? new AMap.EllipseEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4408
+ watchEffect((onCleanup) => {
4409
+ if (!ellipseEditor.value && map.value) ellipseEditor.value = new AMap.EllipseEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4410
+ onCleanup(() => {
4411
+ ellipseEditor.value?.destroy();
4412
+ });
4413
+ });
4414
+ watchEffect(() => {
4415
+ ellipseEditor.value?.setTarget(toValue(props.target));
4416
+ });
4417
+ watch([() => props.createOptions, ellipseEditor], ([val, editor]) => {
4418
+ if (val && editor) editor._normalCircleStyle = AMap.extend(editor._normalCircleStyle, clone(toRaw(val)));
4419
+ });
4420
+ watch([() => props.editOptions, ellipseEditor], ([val, editor]) => {
4421
+ if (val && editor) editor._editStyle = AMap.extend(editor._editStyle, clone(toRaw(val)));
4422
+ });
4423
+ watch([() => props.movePoint, ellipseEditor], ([val, editor]) => {
4424
+ if (val && editor) editor._opts.movePoint = toRaw(val);
4425
+ });
4426
+ watch([() => props.resizeXPoint, ellipseEditor], ([val, editor]) => {
4427
+ if (val && editor) editor._opts.resizeXPoint = toRaw(val);
4428
+ });
4429
+ watch([() => props.resizeYPoint, ellipseEditor], ([val, editor]) => {
4430
+ if (val && editor) editor._opts.resizeYPoint = toRaw(val);
4431
+ });
4432
+ use_event_listeners_default(ellipseEditor, emits, ellipseEditorEvents);
4433
+ __expose({ instance: ellipseEditor });
4434
+ return (_ctx, _cache) => {
4435
+ return null;
4436
+ };
4437
+ }
4438
+ });
4439
+ // src/tool/mouse-tool/mouse-tool.vue
4440
+ var mouse_tool_default = /* @__PURE__ */ defineComponent({
4441
+ name: "AMap.MouseTool",
4442
+ inheritAttrs: false,
4443
+ __name: "mouse-tool",
4444
+ props: {
4445
+ map: {},
4446
+ clearOnClose: {
4447
+ type: Boolean,
4448
+ default: void 0
4449
+ },
4450
+ toolBubble: {
4451
+ type: Boolean,
4452
+ default: void 0
4453
+ }
4454
+ },
4455
+ emits: ["draw"],
4456
+ setup(__props, { expose: __expose, emit: __emit }) {
4457
+ const props = __props;
4458
+ const emits = __emit;
4459
+ const mouseToolEvents = [draw];
4460
+ const map = useMapInstance(props);
4461
+ const mouseTool = shallowRef(map.value ? new AMap.MouseTool(map.value, props.toolBubble) : null);
4462
+ watchEffect((onCleanup) => {
4463
+ if (!mouseTool.value && map.value) mouseTool.value = new AMap.MouseTool(map.value, props.toolBubble);
4464
+ const dragEnable = map.value?.getStatus().dragEnable;
4465
+ onCleanup(() => {
4466
+ mouseTool.value?.close(props.clearOnClose);
4467
+ map.value?.setStatus({ dragEnable });
4468
+ });
4469
+ });
4470
+ watch([() => props.toolBubble, mouseTool], ([val, tool]) => {
4471
+ if (val && tool) tool.overlayBubble = val || false;
4472
+ });
4473
+ use_event_listeners_default(mouseTool, emits, mouseToolEvents);
4474
+ __expose({ instance: mouseTool });
4475
+ return (_ctx, _cache) => {
4476
+ return null;
4477
+ };
4478
+ }
4479
+ });
4480
+ // src/tool/polygon-editor/polygon-editor.vue
4481
+ var polygon_editor_default = /* @__PURE__ */ defineComponent({
4482
+ name: "AMap.PolygonEditor",
4483
+ inheritAttrs: false,
4484
+ __name: "polygon-editor",
4485
+ props: {
4486
+ map: {},
4487
+ target: {},
4488
+ createOptions: {},
4489
+ editOptions: {},
4490
+ controlPoint: {},
4491
+ midControlPoint: {}
4492
+ },
4493
+ emits: [
4494
+ "add",
4495
+ "end",
4496
+ "adjust",
4497
+ "addNode",
4498
+ "removeNode"
4499
+ ],
4500
+ setup(__props, { expose: __expose, emit: __emit }) {
4501
+ const props = __props;
4502
+ const emits = __emit;
4503
+ const polygonEditorEvents = [
4504
+ add,
4505
+ end,
4506
+ adjust,
4507
+ addNode,
4508
+ removeNode
4509
+ ];
4510
+ const map = useMapInstance(props);
4511
+ const restProps = shallowReactiveOmit(props, "map", "target");
4512
+ const polygonEditor = shallowRef(map.value ? new AMap.PolygonEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4513
+ patchPolygonEditor();
4514
+ watchEffect((onCleanup) => {
4515
+ if (!polygonEditor.value && map.value) polygonEditor.value = new AMap.PolygonEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4516
+ onCleanup(() => {
4517
+ polygonEditor.value?.destroy();
4518
+ });
4519
+ });
4520
+ watchEffect(() => {
4521
+ polygonEditor.value?.setTarget(toValue(props.target));
4522
+ });
4523
+ watch([() => props.createOptions, polygonEditor], ([val, editor]) => {
4524
+ if (val && editor) editor._opt.createOptions = clone(toRaw(val));
4525
+ });
4526
+ watch([() => props.editOptions, polygonEditor], ([val, editor]) => {
4527
+ if (val && editor) editor._opt.editOptions = clone(toRaw(val));
4528
+ });
4529
+ watch([() => props.controlPoint, polygonEditor], ([val, editor]) => {
4530
+ if (val && editor) {
4531
+ editor.controlPoint = AMap.extend(editor.controlPoint, clone(toRaw(val)));
4532
+ editor.movePoint = AMap.extend(editor.movePoint, clone(toRaw(val)));
4533
+ }
4534
+ });
4535
+ watch([() => props.midControlPoint, polygonEditor], ([val, editor]) => {
4536
+ if (val && editor) editor.midControlPoint = AMap.extend(editor.midControlPoint, clone(toRaw(val)));
4537
+ });
4538
+ use_event_listeners_default(polygonEditor, emits, polygonEditorEvents);
4539
+ __expose({ instance: polygonEditor });
4540
+ return (_ctx, _cache) => {
4541
+ return null;
4542
+ };
4543
+ }
4544
+ });
4545
+ // src/tool/polyline-editor/polyline-editor.vue
4546
+ var polyline_editor_default = /* @__PURE__ */ defineComponent({
4547
+ name: "AMap.PolylineEditor",
4548
+ inheritAttrs: false,
4549
+ __name: "polyline-editor",
4550
+ props: {
4551
+ map: {},
4552
+ target: {},
4553
+ createOptions: {},
4554
+ editOptions: {},
4555
+ controlPoint: {},
4556
+ midControlPoint: {}
4557
+ },
4558
+ emits: [
4559
+ "add",
4560
+ "end",
4561
+ "adjust",
4562
+ "addNode",
4563
+ "removeNode"
4564
+ ],
4565
+ setup(__props, { expose: __expose, emit: __emit }) {
4566
+ const props = __props;
4567
+ const emits = __emit;
4568
+ const polylineEditorEvents = [
4569
+ add,
4570
+ end,
4571
+ adjust,
4572
+ addNode,
4573
+ removeNode
4574
+ ];
4575
+ const map = useMapInstance(props);
4576
+ const restProps = shallowReactiveOmit(props, "map", "target");
4577
+ const polylineEditor = shallowRef(map.value ? new AMap.PolylineEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4578
+ watchEffect((onCleanup) => {
4579
+ if (!polylineEditor.value && map.value) polylineEditor.value = new AMap.PolylineEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4580
+ onCleanup(() => {
4581
+ polylineEditor.value?.destroy();
4582
+ });
4583
+ });
4584
+ watchEffect(() => {
4585
+ polylineEditor.value?.setTarget(toValue(props.target));
4586
+ });
4587
+ watch([() => props.createOptions, polylineEditor], ([val, editor]) => {
4588
+ if (val && editor) editor._defaultStyle = AMap.extend(editor._defaultStyle, clone(toRaw(val)));
4589
+ });
4590
+ watch([() => props.editOptions, polylineEditor], ([val, editor]) => {
4591
+ if (val && editor) editor._selectStyle = AMap.extend(editor._selectStyle, clone(toRaw(val)));
4592
+ });
4593
+ watch([() => props.controlPoint, polylineEditor], ([val, editor]) => {
4594
+ if (val && editor) editor._markerOptions = AMap.extend(editor._markerOptions, clone(toRaw(val)));
4595
+ });
4596
+ watch([() => props.midControlPoint, polylineEditor], ([val, editor]) => {
4597
+ if (val && editor) editor._middleMarkerOptions = AMap.extend(editor._middleMarkerOptions, clone(toRaw(val)));
4598
+ });
4599
+ use_event_listeners_default(polylineEditor, emits, polylineEditorEvents);
4600
+ __expose({ instance: polylineEditor });
4601
+ return (_ctx, _cache) => {
4602
+ return null;
4603
+ };
4604
+ }
4605
+ });
4606
+ // src/tool/ranging-tool/ranging-tool.vue
4607
+ var ranging_tool_default = /* @__PURE__ */ defineComponent({
4608
+ name: "AMap.RangingTool",
4609
+ inheritAttrs: false,
4610
+ __name: "ranging-tool",
4611
+ props: {
4612
+ map: {},
4613
+ d: {},
4614
+ endLabelOffset: {},
4615
+ endLabelText: {},
4616
+ endMarkerOptions: {},
4617
+ lineOptions: {},
4618
+ midLabelOffset: {},
4619
+ midLabelText: {},
4620
+ midMarkerOptions: {},
4621
+ startLabelOffset: {},
4622
+ startLabelText: {},
4623
+ startMarkerOptions: {},
4624
+ tmpLineOptions: {}
4625
+ },
4626
+ emits: [
4627
+ "addNode",
4628
+ "removeNode",
4629
+ "end"
4630
+ ],
4631
+ setup(__props, { expose: __expose, emit: __emit }) {
4632
+ const props = __props;
4633
+ const emits = __emit;
4634
+ const rangingToolEvents = [
4635
+ addNode,
4636
+ removeNode,
4637
+ end
4638
+ ];
4639
+ const map = useMapInstance(props);
4640
+ const restProps = shallowReactiveOmit(props, "map");
4641
+ const rangingTool = shallowRef(map.value ? new AMap.RangingTool(map.value, toDefinedRaw(restProps)) : null);
4642
+ watchEffect((onCleanup) => {
4643
+ if (!rangingTool.value && map.value) rangingTool.value = new AMap.RangingTool(map.value, toDefinedRaw(restProps));
4644
+ onCleanup(() => {
4645
+ rangingTool.value?.turnOff(true);
4646
+ });
4647
+ });
4648
+ watch(restProps, (val) => {
4649
+ rangingTool.value?.setOptions(toDefinedRaw(val));
4650
+ });
4651
+ use_event_listeners_default(rangingTool, emits, rangingToolEvents);
4652
+ __expose({ instance: rangingTool });
4653
+ return (_ctx, _cache) => {
4654
+ return null;
4655
+ };
4656
+ }
4657
+ });
4658
+ // src/tool/rectangle-editor/rectangle-editor.vue
4659
+ var rectangle_editor_default = /* @__PURE__ */ defineComponent({
4660
+ name: "AMap.RectangleEditor",
4661
+ inheritAttrs: false,
4662
+ __name: "rectangle-editor",
4663
+ props: {
4664
+ map: {},
4665
+ target: {},
4666
+ createOptions: {},
4667
+ editOptions: {},
4668
+ southWestPoint: {},
4669
+ northEastPoint: {}
4670
+ },
4671
+ emits: [
4672
+ "add",
4673
+ "end",
4674
+ "adjust",
4675
+ "move"
4676
+ ],
4677
+ setup(__props, { expose: __expose, emit: __emit }) {
4678
+ const props = __props;
4679
+ const emits = __emit;
4680
+ const rectangleEditorEvents = [
4681
+ add,
4682
+ end,
4683
+ adjust,
4684
+ move
4685
+ ];
4686
+ const map = useMapInstance(props);
4687
+ const restProps = shallowReactiveOmit(props, "map", "target");
4688
+ const rectangleEditor = shallowRef(map.value ? new AMap.RectangleEditor(map.value, toValue(props.target), toDefinedRaw(restProps)) : null);
4689
+ watchEffect((onCleanup) => {
4690
+ if (!rectangleEditor.value && map.value) rectangleEditor.value = new AMap.RectangleEditor(map.value, toValue(props.target), toDefinedRaw(restProps));
4691
+ onCleanup(() => {
4692
+ rectangleEditor.value?.destroy();
4693
+ });
4694
+ });
4695
+ watchEffect(() => {
4696
+ rectangleEditor.value?.setTarget(toValue(props.target));
4697
+ });
4698
+ watch([() => props.createOptions, rectangleEditor], ([val, editor]) => {
4699
+ if (val && editor) editor._normalRectangleStyle = AMap.extend(editor._normalRectangleStyle, clone(toRaw(val)));
4700
+ });
4701
+ watch([() => props.editOptions, rectangleEditor], ([val, editor]) => {
4702
+ if (val && editor) editor._editStyle = AMap.extend(editor._editStyle, clone(toRaw(val)));
4703
+ });
4704
+ watch([() => props.northEastPoint, rectangleEditor], ([val, editor]) => {
4705
+ if (val && editor) editor._opts.northEastPoint = toRaw(val);
4706
+ });
4707
+ watch([() => props.southWestPoint, rectangleEditor], ([val, editor]) => {
4708
+ if (val && editor) editor._opts.southWestPoint = toRaw(val);
4709
+ });
4710
+ use_event_listeners_default(rectangleEditor, emits, rectangleEditorEvents);
4711
+ __expose({ instance: rectangleEditor });
4712
+ return (_ctx, _cache) => {
4713
+ return null;
4714
+ };
4715
+ }
4716
+ });
4717
+ export { api_loader_default as APILoader, bezier_curve_default as BezierCurve, bezier_curve_editor_default as BezierCurveEditor, buildings_default as BuildingLayer, buildings_default as Buildings, canvas_layer_default as CanvasLayer, circle_default as Circle, circle_editor_default as CircleEditor, circle_marker_default as CircleMarker, context_menu_default as ContextMenu, control_bar_default as ControlBar, country_default as Country, custom_layer_default as CustomLayer, district_layer_default as DistrictLayer, elastic_marker_default as ElasticMarker, ellipse_default as Ellipse, ellipse_editor_default as EllipseEditor, flexible_default as Flexible, gl_custom_layer_default as GLCustomLayer, geolocation_default as Geolocation, hawk_eye_default as HawkEye, heat_map_default as HeatMap, image_layer_default as ImageLayer, index_cluster_default as IndexCluster, indoor_map_default as IndoorMap, info_window_default as InfoWindow, label_marker_default as LabelMarker, labels_layer_default as LabelsLayer, layer_group_default as LayerGroup, LoadStatus, map_default as Map, map_type_default as MapType, mapbox_default as Mapbox, mapbox_vector_tile_layer_default as MapboxVectorTileLayer, mark_default as Mark, marker_default as Marker, marker_cluster_default as MarkerCluster, mass_marks_default as MassMarks, mouse_tool_default as MouseTool, overlay_group_default as OverlayGroup, polygon_default as Polygon, polygon_editor_default as PolygonEditor, polyline_default as Polyline, polyline_editor_default as PolylineEditor, province_default as Province, ranging_tool_default as RangingTool, rectangle_default as Rectangle, rectangle_editor_default as RectangleEditor, road_net_default as RoadNet, satellite_default as Satellite, scale_default as Scale, text_default as Text, tile_layer_default as TileLayer, tool_bar_default as ToolBar, traffic_default as Traffic, vector_layer_default as VectorLayer, wms_default as WMS, wmts_default as WMTS, world_default as World, shallowReactiveOmit, useAPILoader, useAPIStatus, use_instance_default as useInstance, useLabelsLayer, useMap, useMapInstance, useVectorLayer };