@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/loca.js ADDED
@@ -0,0 +1,1288 @@
1
+ import { a as toDefinedRaw, i as shallowReactiveOmit, o as use_event_listeners_default, r as useMapInstance } from "./context-BEyZOuBr.js";
2
+ import { computed, defineComponent, inject, onUnmounted, provide, renderSlot, shallowRef, toRaw, watch, watchEffect } from "vue";
3
+ import { clone, lostContextError } from "@cn-map/gaode-shared/utils";
4
+ import { complete, loaded } from "@cn-map/gaode-shared/const";
5
+ import { patchGeoBufferSource, patchGeoJSONSource, patchLocaLayer } from "@cn-map/gaode-shared/patch";
6
+ // src/loca/loca/context.ts
7
+ const AMap_Symbol_Loca = Symbol("Loca");
8
+ /**
9
+ * 设置Loca实例Context
10
+ * @param {ShallowRef<Nullable<Loca.Container>>} loca - Loca实例ref
11
+ */
12
+ function setLocaContext(loca) {
13
+ provide(AMap_Symbol_Loca, loca);
14
+ }
15
+ /**
16
+ * 获取Loca实例
17
+ * @returns {ShallowRef<Nullable<Loca.Container>>} - Loca实例ref
18
+ */
19
+ function useLoca() {
20
+ const context = inject(AMap_Symbol_Loca);
21
+ if (!context) throw lostContextError("`Loca.Container`");
22
+ return context;
23
+ }
24
+ /**
25
+ * 获取Loca实例
26
+ * @returns {ComputedRef<Nullable<Loca.Container>>} - Loca实例ref
27
+ */
28
+ function useLocaInstance(props) {
29
+ const loca = inject(AMap_Symbol_Loca, shallowRef(null));
30
+ return computed(() => props.loca ?? loca.value);
31
+ }
32
+ // src/loca/loca/loca.vue
33
+ var loca_default = /* @__PURE__ */ defineComponent({
34
+ name: "Loca.Container",
35
+ inheritAttrs: false,
36
+ __name: "loca",
37
+ props: { map: {} },
38
+ setup(__props, { expose: __expose }) {
39
+ const map = useMapInstance(__props);
40
+ const loca = shallowRef(null);
41
+ setLocaContext(loca);
42
+ watchEffect((onCleanup) => {
43
+ if (!map.value) return;
44
+ loca.value = new Loca.Container({ map: map.value });
45
+ onCleanup(() => {
46
+ if (loca.value?.map) {
47
+ AMap.Event.clearListeners(loca.value?.map, "firstPaint");
48
+ loca.value?.destroy();
49
+ }
50
+ loca.value = null;
51
+ });
52
+ });
53
+ __expose({ instance: loca });
54
+ return (_ctx, _cache) => {
55
+ return renderSlot(_ctx.$slots, "default");
56
+ };
57
+ }
58
+ });
59
+ // src/loca/source/data-source/context.ts
60
+ const AMap_Symbol_DataSource = Symbol("DataSource");
61
+ /**
62
+ * 设置数据源实例Context
63
+ * @param {ShallowRef<Nullable<Loca.GeoBufferSource | Loca.GeoJSONSource>>} dataSource - 数据源实例ref
64
+ */
65
+ function setDataSourceContext(dataSource) {
66
+ provide(AMap_Symbol_DataSource, dataSource);
67
+ }
68
+ /**
69
+ * 获取数据源实例
70
+ * @returns {ShallowRef<Nullable<Loca.GeoBufferSource | Loca.GeoJSONSource>>} - 数据源实例ref
71
+ */
72
+ function useDataSource() {
73
+ const context = inject(AMap_Symbol_DataSource);
74
+ if (!context) throw lostContextError("`Loca.GeoBufferSource`/`Loca.GeoJSONSource`");
75
+ return context;
76
+ }
77
+ /**
78
+ * 获取数据源实例
79
+ * @returns {ComputedRef<Nullable<Loca.GeoBufferSource | Loca.GeoJSONSource>>} - 数据源实例ref
80
+ */
81
+ function useDataSourceInstance(props) {
82
+ const source = inject(AMap_Symbol_DataSource, shallowRef(null));
83
+ return computed(() => props.source ?? source.value);
84
+ }
85
+ // src/loca/source/data-source/data-source.ts
86
+ function toSnapshot(data, url) {
87
+ if (hasData(data)) return {
88
+ mode: "data",
89
+ value: toRaw(data)
90
+ };
91
+ if (hasUrl(url)) return {
92
+ mode: "url",
93
+ value: url
94
+ };
95
+ return {
96
+ mode: "idle",
97
+ value: void 0
98
+ };
99
+ }
100
+ function hasData(data) {
101
+ return data !== void 0;
102
+ }
103
+ function hasUrl(url) {
104
+ return typeof url === "string" && url.length > 0;
105
+ }
106
+ function reloadSource(source) {
107
+ for (const layer of source.layers) layer.ll?.destroy();
108
+ source.abort?.();
109
+ source.load();
110
+ }
111
+ function useDataSourceAttributes(source, props) {
112
+ watch(() => [props.data, props.url], ([data, url], oldValue) => {
113
+ const currentSource = source.value;
114
+ const prev = oldValue ? toSnapshot(oldValue[0], oldValue[1]) : void 0;
115
+ const next = toSnapshot(data, url);
116
+ if (next.mode === "data") currentSource.options.data = clone(toRaw(next.value), true);
117
+ else delete currentSource.options.data;
118
+ if (next.mode === "url") {
119
+ currentSource.options.url = next.value;
120
+ currentSource.url = next.value;
121
+ } else {
122
+ delete currentSource.options.url;
123
+ currentSource.url = void 0;
124
+ }
125
+ if (next.mode === "idle") {
126
+ if (prev && prev?.mode !== "idle") {
127
+ currentSource.abort?.();
128
+ currentSource.dataset = [];
129
+ for (const layer of currentSource.layers) layer.receiveDataset?.(currentSource.dataset);
130
+ }
131
+ } else if (!prev) {
132
+ if (currentSource.status !== "loading" && currentSource.dataset.length === 0) currentSource.load();
133
+ } else if (prev.mode !== next.mode || prev.value !== next.value) reloadSource(currentSource);
134
+ }, { immediate: true });
135
+ }
136
+ // src/loca/layer/layer/layer.ts
137
+ const layerEvents = [complete, loaded];
138
+ function useLayerAttributes(layer, props, emits) {
139
+ patchLocaLayer();
140
+ const source = useDataSourceInstance(props);
141
+ watch(() => props.opacity, (val) => {
142
+ layer.value.setOpacity(val);
143
+ });
144
+ watch(() => props.zooms, (val) => {
145
+ layer.value.setZooms(clone(toRaw(val)));
146
+ });
147
+ watch(() => props.zIndex, (val) => {
148
+ layer.value.setzIndex(val);
149
+ });
150
+ watch(source, (val, _, onCleanup) => {
151
+ if (val) layer.value.setSource(val);
152
+ onCleanup(() => {
153
+ layer.value.source?.Mr(layer.value);
154
+ });
155
+ }, { immediate: true });
156
+ watch(() => props.style, (val) => {
157
+ if (val !== void 0) layer.value.setStyle(clone(toRaw(val)));
158
+ }, { immediate: true });
159
+ watch(() => props.visible, (val) => {
160
+ if (val !== void 0) {
161
+ if (val) layer.value.show(props.duration?.show, () => emits("show"));
162
+ else layer.value.hide(props.duration?.hide, () => emits("hide"));
163
+ }
164
+ }, { immediate: true });
165
+ }
166
+ // src/loca/layer/grid-layer/grid-layer.vue
167
+ var grid_layer_default = /* @__PURE__ */ defineComponent({
168
+ name: "Loca.GridLayer",
169
+ inheritAttrs: false,
170
+ __name: "grid-layer",
171
+ props: {
172
+ source: {},
173
+ duration: {},
174
+ style: {},
175
+ acceptLight: {
176
+ type: Boolean,
177
+ default: void 0
178
+ },
179
+ cullface: {},
180
+ depth: {
181
+ type: Boolean,
182
+ default: void 0
183
+ },
184
+ hasSide: {
185
+ type: Boolean,
186
+ default: void 0
187
+ },
188
+ shininess: {},
189
+ loca: {},
190
+ labelsLayerOptions: {},
191
+ map: {},
192
+ opacity: {},
193
+ preHandle: {
194
+ type: Boolean,
195
+ default: void 0
196
+ },
197
+ visible: {
198
+ type: Boolean,
199
+ default: void 0
200
+ },
201
+ zIndex: {},
202
+ zooms: {}
203
+ },
204
+ emits: [
205
+ "complete",
206
+ "loaded",
207
+ "show",
208
+ "hide"
209
+ ],
210
+ setup(__props, { expose: __expose, emit: __emit }) {
211
+ const props = __props;
212
+ const emits = __emit;
213
+ const loca = useLocaInstance(props);
214
+ const restProps = shallowReactiveOmit(props, "map", "loca");
215
+ const gridLayer = shallowRef(new Loca.GridLayer(toDefinedRaw(restProps)));
216
+ useLayerAttributes(gridLayer, props, emits);
217
+ watchEffect((onCleanup) => {
218
+ loca.value?.add(gridLayer.value);
219
+ onCleanup(() => {
220
+ loca.value?.remove(gridLayer.value);
221
+ });
222
+ });
223
+ use_event_listeners_default(gridLayer, emits, layerEvents);
224
+ onUnmounted(() => {
225
+ gridLayer.value?.destroy();
226
+ });
227
+ __expose({ instance: gridLayer });
228
+ return (_ctx, _cache) => {
229
+ return null;
230
+ };
231
+ }
232
+ });
233
+ // src/loca/layer/heat-map-layer/heat-map-layer.vue
234
+ var heat_map_layer_default = /* @__PURE__ */ defineComponent({
235
+ name: "Loca.HeatMapLayer",
236
+ inheritAttrs: false,
237
+ __name: "heat-map-layer",
238
+ props: {
239
+ source: {},
240
+ duration: {},
241
+ style: {},
242
+ depth: {
243
+ type: Boolean,
244
+ default: void 0
245
+ },
246
+ loca: {},
247
+ labelsLayerOptions: {},
248
+ map: {},
249
+ opacity: {},
250
+ preHandle: {
251
+ type: Boolean,
252
+ default: void 0
253
+ },
254
+ visible: {
255
+ type: Boolean,
256
+ default: void 0
257
+ },
258
+ zIndex: {},
259
+ zooms: {}
260
+ },
261
+ emits: [
262
+ "complete",
263
+ "loaded",
264
+ "show",
265
+ "hide"
266
+ ],
267
+ setup(__props, { expose: __expose, emit: __emit }) {
268
+ const props = __props;
269
+ const emits = __emit;
270
+ const loca = useLocaInstance(props);
271
+ const restProps = shallowReactiveOmit(props, "map", "loca");
272
+ const heatMapLayer = shallowRef(new Loca.HeatMapLayer(toDefinedRaw(restProps)));
273
+ useLayerAttributes(heatMapLayer, props, emits);
274
+ watchEffect((onCleanup) => {
275
+ loca.value?.add(heatMapLayer.value);
276
+ onCleanup(() => {
277
+ loca.value?.remove(heatMapLayer.value);
278
+ });
279
+ });
280
+ use_event_listeners_default(heatMapLayer, emits, layerEvents);
281
+ onUnmounted(() => {
282
+ heatMapLayer.value?.destroy();
283
+ });
284
+ __expose({ instance: heatMapLayer });
285
+ return (_ctx, _cache) => {
286
+ return null;
287
+ };
288
+ }
289
+ });
290
+ // src/loca/layer/hexagon-layer/hexagon-layer.vue
291
+ var hexagon_layer_default = /* @__PURE__ */ defineComponent({
292
+ name: "Loca.HexagonLayer",
293
+ inheritAttrs: false,
294
+ __name: "hexagon-layer",
295
+ props: {
296
+ source: {},
297
+ duration: {},
298
+ style: {},
299
+ acceptLight: {
300
+ type: Boolean,
301
+ default: void 0
302
+ },
303
+ cullface: {},
304
+ depth: {
305
+ type: Boolean,
306
+ default: void 0
307
+ },
308
+ hasBottom: {
309
+ type: Boolean,
310
+ default: void 0
311
+ },
312
+ hasSide: {
313
+ type: Boolean,
314
+ default: void 0
315
+ },
316
+ shininess: {},
317
+ loca: {},
318
+ labelsLayerOptions: {},
319
+ map: {},
320
+ opacity: {},
321
+ preHandle: {
322
+ type: Boolean,
323
+ default: void 0
324
+ },
325
+ visible: {
326
+ type: Boolean,
327
+ default: void 0
328
+ },
329
+ zIndex: {},
330
+ zooms: {}
331
+ },
332
+ emits: [
333
+ "complete",
334
+ "loaded",
335
+ "show",
336
+ "hide"
337
+ ],
338
+ setup(__props, { expose: __expose, emit: __emit }) {
339
+ const props = __props;
340
+ const emits = __emit;
341
+ const loca = useLocaInstance(props);
342
+ const restProps = shallowReactiveOmit(props, "map", "loca");
343
+ const hexagonLayer = shallowRef(new Loca.HexagonLayer(toDefinedRaw(restProps)));
344
+ useLayerAttributes(hexagonLayer, props, emits);
345
+ watchEffect((onCleanup) => {
346
+ loca.value?.add(hexagonLayer.value);
347
+ onCleanup(() => {
348
+ loca.value?.remove(hexagonLayer.value);
349
+ });
350
+ });
351
+ use_event_listeners_default(hexagonLayer, emits, layerEvents);
352
+ onUnmounted(() => {
353
+ hexagonLayer.value?.destroy();
354
+ });
355
+ __expose({ instance: hexagonLayer });
356
+ return (_ctx, _cache) => {
357
+ return null;
358
+ };
359
+ }
360
+ });
361
+ // src/loca/layer/icon-layer/icon-layer.vue
362
+ var icon_layer_default = /* @__PURE__ */ defineComponent({
363
+ name: "Loca.IconLayer",
364
+ inheritAttrs: false,
365
+ __name: "icon-layer",
366
+ props: {
367
+ source: {},
368
+ duration: {},
369
+ style: {},
370
+ loca: {},
371
+ labelsLayerOptions: {},
372
+ map: {},
373
+ opacity: {},
374
+ preHandle: {
375
+ type: Boolean,
376
+ default: void 0
377
+ },
378
+ visible: {
379
+ type: Boolean,
380
+ default: void 0
381
+ },
382
+ zIndex: {},
383
+ zooms: {}
384
+ },
385
+ emits: [
386
+ "complete",
387
+ "loaded",
388
+ "show",
389
+ "hide"
390
+ ],
391
+ setup(__props, { expose: __expose, emit: __emit }) {
392
+ const props = __props;
393
+ const emits = __emit;
394
+ const loca = useLocaInstance(props);
395
+ const restProps = shallowReactiveOmit(props, "map", "loca");
396
+ const iconLayer = shallowRef(new Loca.IconLayer(toDefinedRaw(restProps)));
397
+ useLayerAttributes(iconLayer, props, emits);
398
+ watchEffect((onCleanup) => {
399
+ loca.value?.add(iconLayer.value);
400
+ onCleanup(() => {
401
+ loca.value?.remove(iconLayer.value);
402
+ });
403
+ });
404
+ use_event_listeners_default(iconLayer, emits, layerEvents);
405
+ onUnmounted(() => {
406
+ iconLayer.value?.destroy();
407
+ });
408
+ __expose({ instance: iconLayer });
409
+ return (_ctx, _cache) => {
410
+ return null;
411
+ };
412
+ }
413
+ });
414
+ // src/loca/layer/labels-layer/labels-layer.vue
415
+ var labels_layer_default = /* @__PURE__ */ defineComponent({
416
+ name: "Loca.LabelsLayer",
417
+ inheritAttrs: false,
418
+ __name: "labels-layer",
419
+ props: {
420
+ source: {},
421
+ duration: {},
422
+ style: {},
423
+ loca: {},
424
+ labelsLayerOptions: {},
425
+ map: {},
426
+ opacity: {},
427
+ preHandle: {
428
+ type: Boolean,
429
+ default: void 0
430
+ },
431
+ visible: {
432
+ type: Boolean,
433
+ default: void 0
434
+ },
435
+ zIndex: {},
436
+ zooms: {},
437
+ allowCollision: {
438
+ type: Boolean,
439
+ default: void 0
440
+ },
441
+ collision: {
442
+ type: Boolean,
443
+ default: void 0
444
+ }
445
+ },
446
+ emits: [
447
+ "complete",
448
+ "loaded",
449
+ "show",
450
+ "hide"
451
+ ],
452
+ setup(__props, { expose: __expose, emit: __emit }) {
453
+ const props = __props;
454
+ const emits = __emit;
455
+ const loca = useLocaInstance(props);
456
+ const restProps = shallowReactiveOmit(props, "map", "loca");
457
+ const labelsLayer = shallowRef(new Loca.LabelsLayer(toDefinedRaw(restProps)));
458
+ useLayerAttributes(labelsLayer, props, emits);
459
+ watchEffect((onCleanup) => {
460
+ loca.value?.add(labelsLayer.value);
461
+ onCleanup(() => {
462
+ loca.value?.remove(labelsLayer.value);
463
+ });
464
+ });
465
+ watch(() => props.allowCollision, (val) => {
466
+ if (val !== void 0) labelsLayer.value.setAllowCollision(val);
467
+ });
468
+ watch(() => props.collision, (val) => {
469
+ if (val !== void 0) labelsLayer.value.setCollision(val);
470
+ });
471
+ use_event_listeners_default(labelsLayer, emits, layerEvents);
472
+ onUnmounted(() => {
473
+ labelsLayer.value?.destroy();
474
+ });
475
+ __expose({ instance: labelsLayer });
476
+ return (_ctx, _cache) => {
477
+ return null;
478
+ };
479
+ }
480
+ });
481
+ // src/loca/layer/laser-layer/laser-layer.vue
482
+ var laser_layer_default = /* @__PURE__ */ defineComponent({
483
+ name: "Loca.LaserLayer",
484
+ inheritAttrs: false,
485
+ __name: "laser-layer",
486
+ props: {
487
+ source: {},
488
+ duration: {},
489
+ style: {},
490
+ depth: {
491
+ type: Boolean,
492
+ default: void 0
493
+ },
494
+ loca: {},
495
+ labelsLayerOptions: {},
496
+ map: {},
497
+ opacity: {},
498
+ preHandle: {
499
+ type: Boolean,
500
+ default: void 0
501
+ },
502
+ visible: {
503
+ type: Boolean,
504
+ default: void 0
505
+ },
506
+ zIndex: {},
507
+ zooms: {}
508
+ },
509
+ emits: [
510
+ "complete",
511
+ "loaded",
512
+ "show",
513
+ "hide"
514
+ ],
515
+ setup(__props, { expose: __expose, emit: __emit }) {
516
+ const props = __props;
517
+ const emits = __emit;
518
+ const loca = useLocaInstance(props);
519
+ const restProps = shallowReactiveOmit(props, "map", "loca");
520
+ const laserLayer = shallowRef(new Loca.LaserLayer(toDefinedRaw(restProps)));
521
+ useLayerAttributes(laserLayer, props, emits);
522
+ watchEffect((onCleanup) => {
523
+ loca.value?.add(laserLayer.value);
524
+ onCleanup(() => {
525
+ loca.value?.remove(laserLayer.value);
526
+ });
527
+ });
528
+ use_event_listeners_default(laserLayer, emits, layerEvents);
529
+ onUnmounted(() => {
530
+ laserLayer.value?.destroy();
531
+ });
532
+ __expose({ instance: laserLayer });
533
+ return (_ctx, _cache) => {
534
+ return null;
535
+ };
536
+ }
537
+ });
538
+ // src/loca/layer/line-layer/line-layer.vue
539
+ var line_layer_default = /* @__PURE__ */ defineComponent({
540
+ name: "Loca.LineLayer",
541
+ inheritAttrs: false,
542
+ __name: "line-layer",
543
+ props: {
544
+ source: {},
545
+ duration: {},
546
+ style: {},
547
+ depth: {
548
+ type: Boolean,
549
+ default: void 0
550
+ },
551
+ loca: {},
552
+ labelsLayerOptions: {},
553
+ map: {},
554
+ opacity: {},
555
+ preHandle: {
556
+ type: Boolean,
557
+ default: void 0
558
+ },
559
+ visible: {
560
+ type: Boolean,
561
+ default: void 0
562
+ },
563
+ zIndex: {},
564
+ zooms: {}
565
+ },
566
+ emits: [
567
+ "complete",
568
+ "loaded",
569
+ "show",
570
+ "hide"
571
+ ],
572
+ setup(__props, { expose: __expose, emit: __emit }) {
573
+ const props = __props;
574
+ const emits = __emit;
575
+ const loca = useLocaInstance(props);
576
+ const restProps = shallowReactiveOmit(props, "map", "loca");
577
+ const lineLayer = shallowRef(new Loca.LineLayer(toDefinedRaw(restProps)));
578
+ useLayerAttributes(lineLayer, props, emits);
579
+ watchEffect((onCleanup) => {
580
+ loca.value?.add(lineLayer.value);
581
+ onCleanup(() => {
582
+ loca.value?.remove(lineLayer.value);
583
+ });
584
+ });
585
+ use_event_listeners_default(lineLayer, emits, layerEvents);
586
+ onUnmounted(() => {
587
+ lineLayer.value?.destroy();
588
+ });
589
+ __expose({ instance: lineLayer });
590
+ return (_ctx, _cache) => {
591
+ return null;
592
+ };
593
+ }
594
+ });
595
+ // src/loca/layer/link-layer/link-layer.vue
596
+ var link_layer_default = /* @__PURE__ */ defineComponent({
597
+ name: "Loca.LinkLayer",
598
+ inheritAttrs: false,
599
+ __name: "link-layer",
600
+ props: {
601
+ source: {},
602
+ duration: {},
603
+ style: {},
604
+ loca: {},
605
+ labelsLayerOptions: {},
606
+ map: {},
607
+ opacity: {},
608
+ preHandle: {
609
+ type: Boolean,
610
+ default: void 0
611
+ },
612
+ visible: {
613
+ type: Boolean,
614
+ default: void 0
615
+ },
616
+ zIndex: {},
617
+ zooms: {}
618
+ },
619
+ emits: [
620
+ "complete",
621
+ "loaded",
622
+ "show",
623
+ "hide"
624
+ ],
625
+ setup(__props, { expose: __expose, emit: __emit }) {
626
+ const props = __props;
627
+ const emits = __emit;
628
+ const loca = useLocaInstance(props);
629
+ const restProps = shallowReactiveOmit(props, "map", "loca");
630
+ const linkLayer = shallowRef(new Loca.LinkLayer(toDefinedRaw(restProps)));
631
+ useLayerAttributes(linkLayer, props, emits);
632
+ watchEffect((onCleanup) => {
633
+ loca.value?.add(linkLayer.value);
634
+ onCleanup(() => {
635
+ loca.value?.remove(linkLayer.value);
636
+ });
637
+ });
638
+ use_event_listeners_default(linkLayer, emits, layerEvents);
639
+ onUnmounted(() => {
640
+ linkLayer.value?.destroy();
641
+ });
642
+ __expose({ instance: linkLayer });
643
+ return (_ctx, _cache) => {
644
+ return null;
645
+ };
646
+ }
647
+ });
648
+ // src/loca/layer/point-layer/point-layer.vue
649
+ var point_layer_default = /* @__PURE__ */ defineComponent({
650
+ name: "Loca.PointLayer",
651
+ inheritAttrs: false,
652
+ __name: "point-layer",
653
+ props: {
654
+ source: {},
655
+ duration: {},
656
+ style: {},
657
+ blend: {},
658
+ loca: {},
659
+ labelsLayerOptions: {},
660
+ map: {},
661
+ opacity: {},
662
+ preHandle: {
663
+ type: Boolean,
664
+ default: void 0
665
+ },
666
+ visible: {
667
+ type: Boolean,
668
+ default: void 0
669
+ },
670
+ zIndex: {},
671
+ zooms: {}
672
+ },
673
+ emits: [
674
+ "complete",
675
+ "loaded",
676
+ "show",
677
+ "hide"
678
+ ],
679
+ setup(__props, { expose: __expose, emit: __emit }) {
680
+ const props = __props;
681
+ const emits = __emit;
682
+ const loca = useLocaInstance(props);
683
+ const restProps = shallowReactiveOmit(props, "map", "loca");
684
+ const pointLayer = shallowRef(new Loca.PointLayer(toDefinedRaw(restProps)));
685
+ useLayerAttributes(pointLayer, props, emits);
686
+ watchEffect((onCleanup) => {
687
+ loca.value?.add(pointLayer.value);
688
+ onCleanup(() => {
689
+ loca.value?.remove(pointLayer.value);
690
+ });
691
+ });
692
+ use_event_listeners_default(pointLayer, emits, layerEvents);
693
+ onUnmounted(() => {
694
+ pointLayer.value?.destroy();
695
+ });
696
+ __expose({ instance: pointLayer });
697
+ return (_ctx, _cache) => {
698
+ return null;
699
+ };
700
+ }
701
+ });
702
+ // src/loca/layer/polygon-layer/polygon-layer.vue
703
+ var polygon_layer_default = /* @__PURE__ */ defineComponent({
704
+ name: "Loca.PolygonLayer",
705
+ inheritAttrs: false,
706
+ __name: "polygon-layer",
707
+ props: {
708
+ source: {},
709
+ duration: {},
710
+ style: {},
711
+ acceptLight: {
712
+ type: Boolean,
713
+ default: void 0
714
+ },
715
+ blockHide: {
716
+ type: Boolean,
717
+ default: void 0
718
+ },
719
+ cullface: {},
720
+ depth: {
721
+ type: Boolean,
722
+ default: void 0
723
+ },
724
+ hasBottom: {
725
+ type: Boolean,
726
+ default: void 0
727
+ },
728
+ hasSide: {
729
+ type: Boolean,
730
+ default: void 0
731
+ },
732
+ shininess: {},
733
+ loca: {},
734
+ labelsLayerOptions: {},
735
+ map: {},
736
+ opacity: {},
737
+ preHandle: {
738
+ type: Boolean,
739
+ default: void 0
740
+ },
741
+ visible: {
742
+ type: Boolean,
743
+ default: void 0
744
+ },
745
+ zIndex: {},
746
+ zooms: {}
747
+ },
748
+ emits: [
749
+ "complete",
750
+ "loaded",
751
+ "show",
752
+ "hide"
753
+ ],
754
+ setup(__props, { expose: __expose, emit: __emit }) {
755
+ const props = __props;
756
+ const emits = __emit;
757
+ const loca = useLocaInstance(props);
758
+ const restProps = shallowReactiveOmit(props, "map", "loca");
759
+ const polygonLayer = shallowRef(new Loca.PolygonLayer(toDefinedRaw(restProps)));
760
+ useLayerAttributes(polygonLayer, props, emits);
761
+ watchEffect((onCleanup) => {
762
+ loca.value?.add(polygonLayer.value);
763
+ onCleanup(() => {
764
+ loca.value?.remove(polygonLayer.value);
765
+ });
766
+ });
767
+ use_event_listeners_default(polygonLayer, emits, layerEvents);
768
+ onUnmounted(() => {
769
+ polygonLayer.value?.destroy();
770
+ });
771
+ __expose({ instance: polygonLayer });
772
+ return (_ctx, _cache) => {
773
+ return null;
774
+ };
775
+ }
776
+ });
777
+ // src/loca/layer/prism-layer/prism-layer.vue
778
+ var prism_layer_default = /* @__PURE__ */ defineComponent({
779
+ name: "Loca.PrismLayer",
780
+ inheritAttrs: false,
781
+ __name: "prism-layer",
782
+ props: {
783
+ source: {},
784
+ duration: {},
785
+ style: {},
786
+ acceptLight: {
787
+ type: Boolean,
788
+ default: void 0
789
+ },
790
+ cullface: {},
791
+ depth: {
792
+ type: Boolean,
793
+ default: void 0
794
+ },
795
+ hasSide: {
796
+ type: Boolean,
797
+ default: void 0
798
+ },
799
+ shininess: {},
800
+ loca: {},
801
+ labelsLayerOptions: {},
802
+ map: {},
803
+ opacity: {},
804
+ preHandle: {
805
+ type: Boolean,
806
+ default: void 0
807
+ },
808
+ visible: {
809
+ type: Boolean,
810
+ default: void 0
811
+ },
812
+ zIndex: {},
813
+ zooms: {}
814
+ },
815
+ emits: [
816
+ "complete",
817
+ "loaded",
818
+ "show",
819
+ "hide"
820
+ ],
821
+ setup(__props, { expose: __expose, emit: __emit }) {
822
+ const props = __props;
823
+ const emits = __emit;
824
+ const loca = useLocaInstance(props);
825
+ const restProps = shallowReactiveOmit(props, "map", "loca");
826
+ const prismLayer = shallowRef(new Loca.PrismLayer(toDefinedRaw(restProps)));
827
+ useLayerAttributes(prismLayer, props, emits);
828
+ watchEffect((onCleanup) => {
829
+ loca.value?.add(prismLayer.value);
830
+ onCleanup(() => {
831
+ loca.value?.remove(prismLayer.value);
832
+ });
833
+ });
834
+ use_event_listeners_default(prismLayer, emits, layerEvents);
835
+ onUnmounted(() => {
836
+ prismLayer.value?.destroy();
837
+ });
838
+ __expose({ instance: prismLayer });
839
+ return (_ctx, _cache) => {
840
+ return null;
841
+ };
842
+ }
843
+ });
844
+ // src/loca/layer/pulse-line-layer/pulse-line-layer.vue
845
+ var pulse_line_layer_default = /* @__PURE__ */ defineComponent({
846
+ name: "Loca.PulseLineLayer",
847
+ inheritAttrs: false,
848
+ __name: "pulse-line-layer",
849
+ props: {
850
+ source: {},
851
+ duration: {},
852
+ style: {},
853
+ loca: {},
854
+ labelsLayerOptions: {},
855
+ map: {},
856
+ opacity: {},
857
+ preHandle: {
858
+ type: Boolean,
859
+ default: void 0
860
+ },
861
+ visible: {
862
+ type: Boolean,
863
+ default: void 0
864
+ },
865
+ zIndex: {},
866
+ zooms: {}
867
+ },
868
+ emits: [
869
+ "complete",
870
+ "loaded",
871
+ "show",
872
+ "hide"
873
+ ],
874
+ setup(__props, { expose: __expose, emit: __emit }) {
875
+ const props = __props;
876
+ const emits = __emit;
877
+ const loca = useLocaInstance(props);
878
+ const restProps = shallowReactiveOmit(props, "map", "loca");
879
+ const pulseLineLayer = shallowRef(new Loca.PulseLineLayer(toDefinedRaw(restProps)));
880
+ useLayerAttributes(pulseLineLayer, props, emits);
881
+ watchEffect((onCleanup) => {
882
+ loca.value?.add(pulseLineLayer.value);
883
+ onCleanup(() => {
884
+ loca.value?.remove(pulseLineLayer.value);
885
+ });
886
+ });
887
+ use_event_listeners_default(pulseLineLayer, emits, layerEvents);
888
+ onUnmounted(() => {
889
+ pulseLineLayer.value?.destroy();
890
+ });
891
+ __expose({ instance: pulseLineLayer });
892
+ return (_ctx, _cache) => {
893
+ return null;
894
+ };
895
+ }
896
+ });
897
+ // src/loca/layer/pulse-link-layer/pulse-link-layer.vue
898
+ var pulse_link_layer_default = /* @__PURE__ */ defineComponent({
899
+ name: "Loca.PulseLinkLayer",
900
+ inheritAttrs: false,
901
+ __name: "pulse-link-layer",
902
+ props: {
903
+ source: {},
904
+ duration: {},
905
+ style: {},
906
+ depth: {
907
+ type: Boolean,
908
+ default: void 0
909
+ },
910
+ loca: {},
911
+ labelsLayerOptions: {},
912
+ map: {},
913
+ opacity: {},
914
+ preHandle: {
915
+ type: Boolean,
916
+ default: void 0
917
+ },
918
+ visible: {
919
+ type: Boolean,
920
+ default: void 0
921
+ },
922
+ zIndex: {},
923
+ zooms: {}
924
+ },
925
+ emits: [
926
+ "complete",
927
+ "loaded",
928
+ "show",
929
+ "hide"
930
+ ],
931
+ setup(__props, { expose: __expose, emit: __emit }) {
932
+ const props = __props;
933
+ const emits = __emit;
934
+ const loca = useLocaInstance(props);
935
+ const restProps = shallowReactiveOmit(props, "map", "loca");
936
+ const pulseLinkLayer = shallowRef(new Loca.PulseLinkLayer(toDefinedRaw(restProps)));
937
+ useLayerAttributes(pulseLinkLayer, props, emits);
938
+ watchEffect((onCleanup) => {
939
+ loca.value?.add(pulseLinkLayer.value);
940
+ onCleanup(() => {
941
+ loca.value?.remove(pulseLinkLayer.value);
942
+ });
943
+ });
944
+ use_event_listeners_default(pulseLinkLayer, emits, layerEvents);
945
+ onUnmounted(() => {
946
+ pulseLinkLayer.value?.destroy();
947
+ });
948
+ __expose({ instance: pulseLinkLayer });
949
+ return (_ctx, _cache) => {
950
+ return null;
951
+ };
952
+ }
953
+ });
954
+ // src/loca/layer/scatter-layer/scatter-layer.vue
955
+ var scatter_layer_default = /* @__PURE__ */ defineComponent({
956
+ name: "Loca.ScatterLayer",
957
+ inheritAttrs: false,
958
+ __name: "scatter-layer",
959
+ props: {
960
+ source: {},
961
+ duration: {},
962
+ style: {},
963
+ depth: {
964
+ type: Boolean,
965
+ default: void 0
966
+ },
967
+ loca: {},
968
+ labelsLayerOptions: {},
969
+ map: {},
970
+ opacity: {},
971
+ preHandle: {
972
+ type: Boolean,
973
+ default: void 0
974
+ },
975
+ visible: {
976
+ type: Boolean,
977
+ default: void 0
978
+ },
979
+ zIndex: {},
980
+ zooms: {}
981
+ },
982
+ emits: [
983
+ "complete",
984
+ "loaded",
985
+ "show",
986
+ "hide"
987
+ ],
988
+ setup(__props, { expose: __expose, emit: __emit }) {
989
+ const props = __props;
990
+ const emits = __emit;
991
+ const loca = useLocaInstance(props);
992
+ const restProps = shallowReactiveOmit(props, "map", "loca");
993
+ const scatterLayer = shallowRef(new Loca.ScatterLayer(toDefinedRaw(restProps)));
994
+ useLayerAttributes(scatterLayer, props, emits);
995
+ watchEffect((onCleanup) => {
996
+ loca.value?.add(scatterLayer.value);
997
+ onCleanup(() => {
998
+ loca.value?.remove(scatterLayer.value);
999
+ });
1000
+ });
1001
+ use_event_listeners_default(scatterLayer, emits, layerEvents);
1002
+ onUnmounted(() => {
1003
+ scatterLayer.value?.destroy();
1004
+ });
1005
+ __expose({ instance: scatterLayer });
1006
+ return (_ctx, _cache) => {
1007
+ return null;
1008
+ };
1009
+ }
1010
+ });
1011
+ // src/loca/layer/z-marker-layer/z-marker-layer.vue
1012
+ var z_marker_layer_default = /* @__PURE__ */ defineComponent({
1013
+ name: "Loca.ZMarkerLayer",
1014
+ inheritAttrs: false,
1015
+ __name: "z-marker-layer",
1016
+ props: {
1017
+ source: {},
1018
+ duration: {},
1019
+ style: {},
1020
+ depth: {
1021
+ type: Boolean,
1022
+ default: void 0
1023
+ },
1024
+ loca: {},
1025
+ labelsLayerOptions: {},
1026
+ map: {},
1027
+ opacity: {},
1028
+ preHandle: {
1029
+ type: Boolean,
1030
+ default: void 0
1031
+ },
1032
+ visible: {
1033
+ type: Boolean,
1034
+ default: void 0
1035
+ },
1036
+ zIndex: {},
1037
+ zooms: {}
1038
+ },
1039
+ emits: [
1040
+ "complete",
1041
+ "loaded",
1042
+ "show",
1043
+ "hide"
1044
+ ],
1045
+ setup(__props, { expose: __expose, emit: __emit }) {
1046
+ const props = __props;
1047
+ const emits = __emit;
1048
+ const loca = useLocaInstance(props);
1049
+ const restProps = shallowReactiveOmit(props, "map", "loca");
1050
+ const zMarkerLayer = shallowRef(new Loca.ZMarkerLayer(toDefinedRaw(restProps)));
1051
+ useLayerAttributes(zMarkerLayer, props, emits);
1052
+ watchEffect((onCleanup) => {
1053
+ loca.value?.add(zMarkerLayer.value);
1054
+ onCleanup(() => {
1055
+ loca.value?.remove(zMarkerLayer.value);
1056
+ });
1057
+ });
1058
+ use_event_listeners_default(zMarkerLayer, emits, layerEvents);
1059
+ onUnmounted(() => {
1060
+ zMarkerLayer.value?.destroy();
1061
+ });
1062
+ __expose({ instance: zMarkerLayer });
1063
+ return (_ctx, _cache) => {
1064
+ return null;
1065
+ };
1066
+ }
1067
+ });
1068
+ // src/loca/legend/legend.vue
1069
+ var legend_default = /* @__PURE__ */ defineComponent({
1070
+ name: "Loca.Legend",
1071
+ inheritAttrs: false,
1072
+ __name: "legend",
1073
+ props: {
1074
+ dataMap: {},
1075
+ loca: {},
1076
+ style: {},
1077
+ title: {}
1078
+ },
1079
+ setup(__props, { expose: __expose }) {
1080
+ const props = __props;
1081
+ const loca = useLocaInstance(props);
1082
+ const restProps = shallowReactiveOmit(props, "loca");
1083
+ const legend = shallowRef(new Loca.Legend(toDefinedRaw(restProps)));
1084
+ watchEffect((onCleanup) => {
1085
+ if (!loca.value) return;
1086
+ legend.value.addTo(loca.value);
1087
+ onCleanup(() => {
1088
+ legend.value.remove();
1089
+ });
1090
+ });
1091
+ watch([() => props.style, () => props.title], ([style, title]) => {
1092
+ legend.value.setStyle({
1093
+ style: toRaw(style),
1094
+ title: toRaw(title)
1095
+ });
1096
+ });
1097
+ __expose({ instance: legend });
1098
+ return (_ctx, _cache) => {
1099
+ return null;
1100
+ };
1101
+ }
1102
+ });
1103
+ // src/loca/light/ambient-light/ambient-light.vue
1104
+ var ambient_light_default = /* @__PURE__ */ defineComponent({
1105
+ name: "Loca.AmbientLight",
1106
+ inheritAttrs: false,
1107
+ __name: "ambient-light",
1108
+ props: {
1109
+ loca: {},
1110
+ color: {},
1111
+ intensity: {}
1112
+ },
1113
+ setup(__props, { expose: __expose }) {
1114
+ const props = __props;
1115
+ const loca = useLocaInstance(props);
1116
+ const restProps = shallowReactiveOmit(props, "loca");
1117
+ const ambientLight = shallowRef(new Loca.AmbientLight(toDefinedRaw(restProps)));
1118
+ watchEffect((onCleanup) => {
1119
+ loca.value?.addLight(ambientLight.value);
1120
+ onCleanup(() => {
1121
+ loca.value?.removeLight(ambientLight.value);
1122
+ });
1123
+ });
1124
+ watch(() => props.color, (val) => {
1125
+ ambientLight.value.color = val;
1126
+ });
1127
+ watch(() => props.intensity, (val) => {
1128
+ ambientLight.value.intensity = val;
1129
+ });
1130
+ __expose({ instance: ambientLight });
1131
+ return (_ctx, _cache) => {
1132
+ return null;
1133
+ };
1134
+ }
1135
+ });
1136
+ // src/loca/light/directional-light/directional-light.vue
1137
+ var directional_light_default = /* @__PURE__ */ defineComponent({
1138
+ name: "Loca.DirectionalLight",
1139
+ inheritAttrs: false,
1140
+ __name: "directional-light",
1141
+ props: {
1142
+ loca: {},
1143
+ color: {},
1144
+ intensity: {},
1145
+ target: {},
1146
+ position: {}
1147
+ },
1148
+ setup(__props, { expose: __expose }) {
1149
+ const props = __props;
1150
+ const loca = useLocaInstance(props);
1151
+ const restProps = shallowReactiveOmit(props, "loca");
1152
+ const directionalLight = shallowRef(new Loca.DirectionalLight(toDefinedRaw(restProps)));
1153
+ watchEffect((onCleanup) => {
1154
+ loca.value?.addLight(directionalLight.value);
1155
+ onCleanup(() => {
1156
+ loca.value?.removeLight(directionalLight.value);
1157
+ });
1158
+ });
1159
+ watch(() => props.color, (val) => {
1160
+ directionalLight.value.color = val;
1161
+ });
1162
+ watch(() => props.intensity, (val) => {
1163
+ directionalLight.value.intensity = val;
1164
+ });
1165
+ watch(() => props.target, (val) => {
1166
+ directionalLight.value.target = val;
1167
+ });
1168
+ watch(() => props.position, (val) => {
1169
+ directionalLight.value.position = val;
1170
+ });
1171
+ __expose({ instance: directionalLight });
1172
+ return (_ctx, _cache) => {
1173
+ return null;
1174
+ };
1175
+ }
1176
+ });
1177
+ // src/loca/light/point-light/point-light.vue
1178
+ var point_light_default = /* @__PURE__ */ defineComponent({
1179
+ name: "Loca.PointLight",
1180
+ inheritAttrs: false,
1181
+ __name: "point-light",
1182
+ props: {
1183
+ loca: {},
1184
+ color: {},
1185
+ intensity: {},
1186
+ distance: {},
1187
+ position: {}
1188
+ },
1189
+ setup(__props, { expose: __expose }) {
1190
+ const props = __props;
1191
+ const loca = useLocaInstance(props);
1192
+ const restProps = shallowReactiveOmit(props, "loca");
1193
+ const pointLight = shallowRef(new Loca.PointLight(toDefinedRaw(restProps)));
1194
+ watchEffect((onCleanup) => {
1195
+ loca.value?.addLight(pointLight.value);
1196
+ onCleanup(() => {
1197
+ loca.value?.removeLight(pointLight.value);
1198
+ });
1199
+ });
1200
+ watch(() => props.color, (val) => {
1201
+ pointLight.value.color = val;
1202
+ });
1203
+ watch(() => props.intensity, (val) => {
1204
+ pointLight.value.intensity = val;
1205
+ });
1206
+ watch(() => props.distance, (val) => {
1207
+ pointLight.value.distance = val;
1208
+ });
1209
+ watch(() => props.position, (val) => {
1210
+ pointLight.value.position = val;
1211
+ });
1212
+ __expose({ instance: pointLight });
1213
+ return (_ctx, _cache) => {
1214
+ return null;
1215
+ };
1216
+ }
1217
+ });
1218
+ // src/loca/source/geo-buffer-source/geo-buffer-source.vue
1219
+ var geo_buffer_source_default = /* @__PURE__ */ defineComponent({
1220
+ name: "Loca.GeoBufferSource",
1221
+ inheritAttrs: false,
1222
+ __name: "geo-buffer-source",
1223
+ props: {
1224
+ layer: {},
1225
+ data: {},
1226
+ url: {}
1227
+ },
1228
+ setup(__props, { expose: __expose }) {
1229
+ const props = __props;
1230
+ patchGeoBufferSource();
1231
+ const restProps = shallowReactiveOmit(props, "layer");
1232
+ const geoBufferSource = shallowRef(new Loca.GeoBufferSource(toDefinedRaw(restProps)));
1233
+ setDataSourceContext(geoBufferSource);
1234
+ watchEffect((onCleanup) => {
1235
+ if (!props.layer) return;
1236
+ props.layer.setSource(geoBufferSource.value);
1237
+ onCleanup(() => {
1238
+ if (!props.layer) return;
1239
+ geoBufferSource.value.Mr(props.layer);
1240
+ });
1241
+ });
1242
+ useDataSourceAttributes(geoBufferSource, restProps);
1243
+ onUnmounted(() => {
1244
+ geoBufferSource.value.abort();
1245
+ geoBufferSource.value.destroy();
1246
+ });
1247
+ __expose({ instance: geoBufferSource });
1248
+ return (_ctx, _cache) => {
1249
+ return renderSlot(_ctx.$slots, "default");
1250
+ };
1251
+ }
1252
+ });
1253
+ // src/loca/source/geo-json-source/geo-json-source.vue
1254
+ var geo_json_source_default = /* @__PURE__ */ defineComponent({
1255
+ name: "Loca.GeoJSONSource",
1256
+ inheritAttrs: false,
1257
+ __name: "geo-json-source",
1258
+ props: {
1259
+ layer: {},
1260
+ data: {},
1261
+ url: {}
1262
+ },
1263
+ setup(__props, { expose: __expose }) {
1264
+ const props = __props;
1265
+ patchGeoJSONSource();
1266
+ const restProps = shallowReactiveOmit(props, "layer");
1267
+ const geoJSONSource = shallowRef(new Loca.GeoJSONSource(toDefinedRaw(restProps)));
1268
+ setDataSourceContext(geoJSONSource);
1269
+ watchEffect((onCleanup) => {
1270
+ if (!props.layer) return;
1271
+ props.layer.setSource(geoJSONSource.value);
1272
+ onCleanup(() => {
1273
+ if (!props.layer) return;
1274
+ geoJSONSource.value.Mr(props.layer);
1275
+ });
1276
+ });
1277
+ useDataSourceAttributes(geoJSONSource, restProps);
1278
+ onUnmounted(() => {
1279
+ geoJSONSource.value.abort();
1280
+ geoJSONSource.value.destroy();
1281
+ });
1282
+ __expose({ instance: geoJSONSource });
1283
+ return (_ctx, _cache) => {
1284
+ return renderSlot(_ctx.$slots, "default");
1285
+ };
1286
+ }
1287
+ });
1288
+ export { ambient_light_default as AmbientLight, directional_light_default as DirectionalLight, geo_buffer_source_default as GeoBufferSource, geo_json_source_default as GeoJSONSource, grid_layer_default as GridLayer, heat_map_layer_default as HeatMapLayer, hexagon_layer_default as HexagonLayer, icon_layer_default as IconLayer, labels_layer_default as LabelsLayer, laser_layer_default as LaserLayer, legend_default as Legend, line_layer_default as LineLayer, link_layer_default as LinkLayer, loca_default as Loca, point_layer_default as PointLayer, point_light_default as PointLight, polygon_layer_default as PolygonLayer, prism_layer_default as PrismLayer, pulse_line_layer_default as PulseLineLayer, pulse_link_layer_default as PulseLinkLayer, scatter_layer_default as ScatterLayer, z_marker_layer_default as ZMarkerLayer, useDataSource, useLoca };