@songcf/fy-map 1.0.0

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.
Files changed (43) hide show
  1. package/README.md +5 -0
  2. package/dist/components/Button/index.d.ts +2 -0
  3. package/dist/components/Button/index.vue.d.ts +4 -0
  4. package/dist/components/FyCircle/index.d.ts +2 -0
  5. package/dist/components/FyCircle/index.vue.d.ts +112 -0
  6. package/dist/components/FyClusterMarker/index.d.ts +2 -0
  7. package/dist/components/FyClusterMarker/index.vue.d.ts +129 -0
  8. package/dist/components/FyDrawCircle/index.d.ts +2 -0
  9. package/dist/components/FyDrawCircle/index.vue.d.ts +76 -0
  10. package/dist/components/FyDrawLine/index.d.ts +2 -0
  11. package/dist/components/FyDrawLine/index.vue.d.ts +72 -0
  12. package/dist/components/FyDrawPoint/index.d.ts +2 -0
  13. package/dist/components/FyDrawPoint/index.vue.d.ts +67 -0
  14. package/dist/components/FyDrawPolygon/index.d.ts +2 -0
  15. package/dist/components/FyDrawPolygon/index.vue.d.ts +75 -0
  16. package/dist/components/FyDrawTool/index.d.ts +2 -0
  17. package/dist/components/FyDrawTool/index.vue.d.ts +102 -0
  18. package/dist/components/FyLabel/index.d.ts +2 -0
  19. package/dist/components/FyLabel/index.vue.d.ts +112 -0
  20. package/dist/components/FyLineString/index.d.ts +2 -0
  21. package/dist/components/FyLineString/index.vue.d.ts +105 -0
  22. package/dist/components/FyMap/index.d.ts +2 -0
  23. package/dist/components/FyMap/index.vue.d.ts +69 -0
  24. package/dist/components/FyMarker/index.d.ts +2 -0
  25. package/dist/components/FyMarker/index.vue.d.ts +105 -0
  26. package/dist/components/FyPoint/index.d.ts +2 -0
  27. package/dist/components/FyPoint/index.vue.d.ts +98 -0
  28. package/dist/components/FyPolygon/index.d.ts +2 -0
  29. package/dist/components/FyPolygon/index.vue.d.ts +98 -0
  30. package/dist/components/FyPopup/index.d.ts +2 -0
  31. package/dist/components/FyPopup/index.vue.d.ts +114 -0
  32. package/dist/components/FyTileLayer/index.d.ts +2 -0
  33. package/dist/components/FyTileLayer/index.vue.d.ts +83 -0
  34. package/dist/components/FyVectorLayer/index.d.ts +2 -0
  35. package/dist/components/FyVectorLayer/index.vue.d.ts +89 -0
  36. package/dist/components/index.d.ts +20 -0
  37. package/dist/fy-map.css +623 -0
  38. package/dist/fy-map.es.js +3769 -0
  39. package/dist/fy-map.es.js.map +1 -0
  40. package/dist/fy-map.umd.js +4415 -0
  41. package/dist/fy-map.umd.js.map +1 -0
  42. package/dist/index.d.ts +5 -0
  43. package/package.json +48 -0
@@ -0,0 +1,3769 @@
1
+ import * as maptalks from "maptalks";
2
+ function normalizeComponent(scriptExports, render18, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
3
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
4
+ if (render18) {
5
+ options.render = render18;
6
+ options.staticRenderFns = staticRenderFns;
7
+ options._compiled = true;
8
+ }
9
+ if (scopeId) {
10
+ options._scopeId = "data-v-" + scopeId;
11
+ }
12
+ return {
13
+ exports: scriptExports,
14
+ options
15
+ };
16
+ }
17
+ const _sfc_main$g = {
18
+ name: "MyButton"
19
+ };
20
+ var _sfc_render$g = function render() {
21
+ var _vm = this, _c = _vm._self._c;
22
+ return _c("button", { staticClass: "my-btn" }, [_vm._t("default")], 2);
23
+ };
24
+ var _sfc_staticRenderFns$g = [];
25
+ var __component__$g = /* @__PURE__ */ normalizeComponent(
26
+ _sfc_main$g,
27
+ _sfc_render$g,
28
+ _sfc_staticRenderFns$g,
29
+ false,
30
+ null,
31
+ "47deef6b"
32
+ );
33
+ const ButtonComponent = __component__$g.exports;
34
+ const MyButton = ButtonComponent;
35
+ MyButton.install = function(Vue) {
36
+ Vue.component(MyButton.name || "MyButton", MyButton);
37
+ };
38
+ const _sfc_main$f = {
39
+ name: "FyMap",
40
+ props: {
41
+ // 地图配置
42
+ options: {
43
+ type: Object,
44
+ default: () => ({})
45
+ },
46
+ // 中心点 [经度, 纬度]
47
+ center: {
48
+ type: Array,
49
+ default: () => [0, 0]
50
+ },
51
+ // 缩放级别
52
+ zoom: {
53
+ type: Number,
54
+ default: 13
55
+ },
56
+ // 最小缩放级别
57
+ minZoom: {
58
+ type: Number,
59
+ default: 1
60
+ },
61
+ // 最大缩放级别
62
+ maxZoom: {
63
+ type: Number,
64
+ default: 22
65
+ },
66
+ // 底图类型
67
+ baseLayer: {
68
+ type: String,
69
+ default: "osm"
70
+ // osm, cartoDB, google, custom
71
+ },
72
+ // 自定义底图URL模板
73
+ baseLayerUrl: {
74
+ type: String,
75
+ default: ""
76
+ },
77
+ // 底图子域名
78
+ subdomains: {
79
+ type: Array,
80
+ default: () => ["a", "b", "c"]
81
+ }
82
+ },
83
+ data() {
84
+ return {
85
+ map: null,
86
+ baseLayerInstance: null
87
+ };
88
+ },
89
+ mounted() {
90
+ this.initMap();
91
+ this.addBaseLayer();
92
+ this.$emit("ready", this.map);
93
+ },
94
+ beforeDestroy() {
95
+ if (this.map) {
96
+ this.map.remove();
97
+ }
98
+ },
99
+ methods: {
100
+ // 初始化地图
101
+ initMap() {
102
+ const config = {
103
+ ...this.options,
104
+ center: this.center,
105
+ zoom: this.zoom,
106
+ minZoom: this.minZoom,
107
+ maxZoom: this.maxZoom
108
+ };
109
+ this.map = new maptalks.Map(this.$refs.mapContainer, config);
110
+ },
111
+ // 添加底图
112
+ addBaseLayer() {
113
+ if (!this.map) return;
114
+ let tileLayer;
115
+ switch (this.baseLayer) {
116
+ case "osm":
117
+ tileLayer = new maptalks.TileLayer("base", {
118
+ urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
119
+ subdomains: ["a", "b", "c"],
120
+ attribution: "© OpenStreetMap contributors"
121
+ });
122
+ break;
123
+ case "cartoDB":
124
+ tileLayer = new maptalks.TileLayer("base", {
125
+ urlTemplate: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
126
+ subdomains: ["a", "b", "c", "d"],
127
+ attribution: "© CartoDB"
128
+ });
129
+ break;
130
+ case "google":
131
+ tileLayer = new maptalks.TileLayer("base", {
132
+ urlTemplate: "http://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
133
+ subdomains: ["0", "1", "2", "3"],
134
+ attribution: "© Google"
135
+ });
136
+ break;
137
+ case "custom":
138
+ if (this.baseLayerUrl) {
139
+ tileLayer = new maptalks.TileLayer("base", {
140
+ urlTemplate: this.baseLayerUrl,
141
+ subdomains: this.subdomains
142
+ });
143
+ }
144
+ break;
145
+ default:
146
+ tileLayer = new maptalks.TileLayer("base", {
147
+ urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
148
+ subdomains: ["a", "b", "c"],
149
+ attribution: "© OpenStreetMap contributors"
150
+ });
151
+ }
152
+ if (tileLayer) {
153
+ this.baseLayerInstance = tileLayer;
154
+ this.map.addLayer(tileLayer);
155
+ }
156
+ },
157
+ // 切换底图
158
+ switchBaseLayer(layerType, urlTemplate = "") {
159
+ if (!this.map) return;
160
+ if (this.baseLayerInstance) {
161
+ this.map.removeLayer(this.baseLayerInstance);
162
+ }
163
+ this.baseLayer = layerType;
164
+ if (urlTemplate) {
165
+ this.baseLayerUrl = urlTemplate;
166
+ }
167
+ this.addBaseLayer();
168
+ },
169
+ // 设置中心点
170
+ setCenter(center) {
171
+ if (this.map) {
172
+ this.map.setCenter(center);
173
+ }
174
+ },
175
+ // 设置缩放级别
176
+ setZoom(zoom) {
177
+ if (this.map) {
178
+ this.map.setZoom(zoom);
179
+ }
180
+ },
181
+ // 飞到指定位置
182
+ flyTo(center, zoom, options = {}) {
183
+ if (this.map) {
184
+ this.map.animateTo(
185
+ {
186
+ center,
187
+ zoom
188
+ },
189
+ options
190
+ );
191
+ }
192
+ },
193
+ // 获取地图实例
194
+ getMap() {
195
+ return this.map;
196
+ }
197
+ },
198
+ provide() {
199
+ return {
200
+ mapInstance: this.map
201
+ };
202
+ }
203
+ };
204
+ var _sfc_render$f = function render2() {
205
+ var _vm = this, _c = _vm._self._c;
206
+ return _c("div", { ref: "mapContainer", staticClass: "fy-map" });
207
+ };
208
+ var _sfc_staticRenderFns$f = [];
209
+ var __component__$f = /* @__PURE__ */ normalizeComponent(
210
+ _sfc_main$f,
211
+ _sfc_render$f,
212
+ _sfc_staticRenderFns$f,
213
+ false,
214
+ null,
215
+ "1c68cf57"
216
+ );
217
+ const FyMapComponent = __component__$f.exports;
218
+ const FyMap = FyMapComponent;
219
+ FyMap.install = function(Vue) {
220
+ Vue.component(FyMap.name || "FyMap", FyMap);
221
+ };
222
+ const _sfc_main$e = {
223
+ name: "FyTileLayer",
224
+ props: {
225
+ // 图层ID
226
+ id: {
227
+ type: String,
228
+ default: "tile-layer"
229
+ },
230
+ // 瓦片URL模板
231
+ urlTemplate: {
232
+ type: String,
233
+ required: true
234
+ },
235
+ // 子域名
236
+ subdomains: {
237
+ type: Array,
238
+ default: () => ["a", "b", "c"]
239
+ },
240
+ // 最小缩放级别
241
+ minZoom: {
242
+ type: Number,
243
+ default: null
244
+ },
245
+ // 最大缩放级别
246
+ maxZoom: {
247
+ type: Number,
248
+ default: null
249
+ },
250
+ // 透明度
251
+ opacity: {
252
+ type: Number,
253
+ default: 1
254
+ },
255
+ // 可见性
256
+ visible: {
257
+ type: Boolean,
258
+ default: true
259
+ },
260
+ // 版权信息
261
+ attribution: {
262
+ type: String,
263
+ default: ""
264
+ },
265
+ // 图层Z轴顺序
266
+ zIndex: {
267
+ type: Number,
268
+ default: 1
269
+ }
270
+ },
271
+ data() {
272
+ return {
273
+ layer: null
274
+ };
275
+ },
276
+ inject: {
277
+ mapInstance: {
278
+ default: null
279
+ }
280
+ },
281
+ mounted() {
282
+ if (this.mapInstance) {
283
+ this.initLayer();
284
+ }
285
+ },
286
+ beforeDestroy() {
287
+ this.removeLayer();
288
+ },
289
+ methods: {
290
+ // 初始化图层
291
+ initLayer() {
292
+ const config = {
293
+ id: this.id,
294
+ urlTemplate: this.urlTemplate,
295
+ subdomains: this.subdomains,
296
+ opacity: this.opacity,
297
+ visible: this.visible,
298
+ attribution: this.attribution,
299
+ zIndex: this.zIndex
300
+ };
301
+ if (this.minZoom !== null) {
302
+ config.minZoom = this.minZoom;
303
+ }
304
+ if (this.maxZoom !== null) {
305
+ config.maxZoom = this.maxZoom;
306
+ }
307
+ this.layer = new maptalks.TileLayer(this.id, config);
308
+ this.mapInstance.addLayer(this.layer);
309
+ this.$emit("ready", this.layer);
310
+ },
311
+ // 移除图层
312
+ removeLayer() {
313
+ if (this.layer && this.mapInstance) {
314
+ this.mapInstance.removeLayer(this.layer);
315
+ this.layer = null;
316
+ }
317
+ },
318
+ // 显示图层
319
+ show() {
320
+ if (this.layer) {
321
+ this.layer.show();
322
+ }
323
+ },
324
+ // 隐藏图层
325
+ hide() {
326
+ if (this.layer) {
327
+ this.layer.hide();
328
+ }
329
+ },
330
+ // 设置透明度
331
+ setOpacity(opacity) {
332
+ if (this.layer) {
333
+ this.layer.setOpacity(opacity);
334
+ }
335
+ },
336
+ // 设置Z轴顺序
337
+ setZIndex(zIndex) {
338
+ if (this.layer) {
339
+ this.layer.setZIndex(zIndex);
340
+ }
341
+ },
342
+ // 获取图层实例
343
+ getLayer() {
344
+ return this.layer;
345
+ }
346
+ },
347
+ watch: {
348
+ visible(newVal) {
349
+ if (newVal) {
350
+ this.show();
351
+ } else {
352
+ this.hide();
353
+ }
354
+ },
355
+ opacity(newVal) {
356
+ this.setOpacity(newVal);
357
+ },
358
+ zIndex(newVal) {
359
+ this.setZIndex(newVal);
360
+ }
361
+ }
362
+ };
363
+ var _sfc_render$e = function render3() {
364
+ var _vm = this, _c = _vm._self._c;
365
+ return _c("div", { staticClass: "fy-tile-layer" });
366
+ };
367
+ var _sfc_staticRenderFns$e = [];
368
+ var __component__$e = /* @__PURE__ */ normalizeComponent(
369
+ _sfc_main$e,
370
+ _sfc_render$e,
371
+ _sfc_staticRenderFns$e,
372
+ false,
373
+ null,
374
+ "56cfee19"
375
+ );
376
+ const FyTileLayerComponent = __component__$e.exports;
377
+ const FyTileLayer = FyTileLayerComponent;
378
+ FyTileLayer.install = function(Vue) {
379
+ Vue.component(FyTileLayer.name || "FyTileLayer", FyTileLayer);
380
+ };
381
+ const _sfc_main$d = {
382
+ name: "FyVectorLayer",
383
+ props: {
384
+ // 图层ID
385
+ id: {
386
+ type: String,
387
+ default: "vector-layer"
388
+ },
389
+ // 渲染类型
390
+ renderer: {
391
+ type: String,
392
+ default: "canvas"
393
+ // canvas, dom
394
+ },
395
+ // 透明度
396
+ opacity: {
397
+ type: Number,
398
+ default: 1
399
+ },
400
+ // 可见性
401
+ visible: {
402
+ type: Boolean,
403
+ default: true
404
+ },
405
+ // 最小缩放级别
406
+ minZoom: {
407
+ type: Number,
408
+ default: null
409
+ },
410
+ // 最大缩放级别
411
+ maxZoom: {
412
+ type: Number,
413
+ default: null
414
+ },
415
+ // 图层Z轴顺序
416
+ zIndex: {
417
+ type: Number,
418
+ default: 10
419
+ },
420
+ // 是否启用碰撞检测
421
+ enableCollision: {
422
+ type: Boolean,
423
+ default: false
424
+ },
425
+ // 图层样式
426
+ style: {
427
+ type: Object,
428
+ default: () => ({})
429
+ }
430
+ },
431
+ data() {
432
+ return {
433
+ layer: null
434
+ };
435
+ },
436
+ inject: {
437
+ mapInstance: {
438
+ default: null
439
+ }
440
+ },
441
+ mounted() {
442
+ if (this.mapInstance) {
443
+ this.initLayer();
444
+ }
445
+ },
446
+ beforeDestroy() {
447
+ this.removeLayer();
448
+ },
449
+ methods: {
450
+ // 初始化图层
451
+ initLayer() {
452
+ const config = {
453
+ id: this.id,
454
+ renderer: this.renderer,
455
+ opacity: this.opacity,
456
+ visible: this.visible,
457
+ zIndex: this.zIndex,
458
+ enableCollision: this.enableCollision,
459
+ style: this.style
460
+ };
461
+ if (this.minZoom !== null) {
462
+ config.minZoom = this.minZoom;
463
+ }
464
+ if (this.maxZoom !== null) {
465
+ config.maxZoom = this.maxZoom;
466
+ }
467
+ this.layer = new maptalks.VectorLayer(this.id, config);
468
+ this.mapInstance.addLayer(this.layer);
469
+ this.$emit("ready", this.layer);
470
+ },
471
+ // 移除图层
472
+ removeLayer() {
473
+ if (this.layer && this.mapInstance) {
474
+ this.mapInstance.removeLayer(this.layer);
475
+ this.layer = null;
476
+ }
477
+ },
478
+ // 添加几何图形
479
+ addGeometry(geometries) {
480
+ if (this.layer && geometries) {
481
+ if (Array.isArray(geometries)) {
482
+ this.layer.addGeometry(geometries);
483
+ } else {
484
+ this.layer.addGeometry(geometries);
485
+ }
486
+ }
487
+ },
488
+ // 移除几何图形
489
+ removeGeometry(geometries) {
490
+ if (this.layer && geometries) {
491
+ if (Array.isArray(geometries)) {
492
+ this.layer.removeGeometry(geometries);
493
+ } else {
494
+ this.layer.removeGeometry(geometries);
495
+ }
496
+ }
497
+ },
498
+ // 清空图层
499
+ clear() {
500
+ if (this.layer) {
501
+ this.layer.clear();
502
+ }
503
+ },
504
+ // 显示图层
505
+ show() {
506
+ if (this.layer) {
507
+ this.layer.show();
508
+ }
509
+ },
510
+ // 隐藏图层
511
+ hide() {
512
+ if (this.layer) {
513
+ this.layer.hide();
514
+ }
515
+ },
516
+ // 设置透明度
517
+ setOpacity(opacity) {
518
+ if (this.layer) {
519
+ this.layer.setOpacity(opacity);
520
+ }
521
+ },
522
+ // 设置Z轴顺序
523
+ setZIndex(zIndex) {
524
+ if (this.layer) {
525
+ this.layer.setZIndex(zIndex);
526
+ }
527
+ },
528
+ // 设置样式
529
+ setStyle(style) {
530
+ if (this.layer) {
531
+ this.layer.setStyle(style);
532
+ }
533
+ },
534
+ // 获取图层实例
535
+ getLayer() {
536
+ return this.layer;
537
+ },
538
+ // 获取所有几何图形
539
+ getGeometries() {
540
+ if (this.layer) {
541
+ return this.layer.getGeometries();
542
+ }
543
+ return [];
544
+ }
545
+ },
546
+ watch: {
547
+ visible(newVal) {
548
+ if (newVal) {
549
+ this.show();
550
+ } else {
551
+ this.hide();
552
+ }
553
+ },
554
+ opacity(newVal) {
555
+ this.setOpacity(newVal);
556
+ },
557
+ zIndex(newVal) {
558
+ this.setZIndex(newVal);
559
+ }
560
+ }
561
+ };
562
+ var _sfc_render$d = function render4() {
563
+ var _vm = this, _c = _vm._self._c;
564
+ return _c("div", { staticClass: "fy-vector-layer" });
565
+ };
566
+ var _sfc_staticRenderFns$d = [];
567
+ var __component__$d = /* @__PURE__ */ normalizeComponent(
568
+ _sfc_main$d,
569
+ _sfc_render$d,
570
+ _sfc_staticRenderFns$d,
571
+ false,
572
+ null,
573
+ "cd2b9e14"
574
+ );
575
+ const FyVectorLayerComponent = __component__$d.exports;
576
+ const FyVectorLayer = FyVectorLayerComponent;
577
+ FyVectorLayer.install = function(Vue) {
578
+ Vue.component(FyVectorLayer.name || "FyVectorLayer", FyVectorLayer);
579
+ };
580
+ const _sfc_main$c = {
581
+ name: "FyMarker",
582
+ props: {
583
+ // 位置坐标 [经度, 纬度]
584
+ coordinates: {
585
+ type: Array,
586
+ required: true
587
+ },
588
+ // 图标图片URL
589
+ icon: {
590
+ type: String,
591
+ default: ""
592
+ },
593
+ // 图标尺寸
594
+ iconSize: {
595
+ type: Array,
596
+ default: () => [32, 32]
597
+ },
598
+ // 图标偏移
599
+ iconOffset: {
600
+ type: Array,
601
+ default: () => [0, 0]
602
+ },
603
+ // 旋转角度
604
+ rotation: {
605
+ type: Number,
606
+ default: 0
607
+ },
608
+ // 透明度
609
+ opacity: {
610
+ type: Number,
611
+ default: 1
612
+ },
613
+ // 可见性
614
+ visible: {
615
+ type: Boolean,
616
+ default: true
617
+ },
618
+ // 可拖拽
619
+ draggable: {
620
+ type: Boolean,
621
+ default: false
622
+ },
623
+ // 弹曲程度
624
+ curve: {
625
+ type: Number,
626
+ default: 0
627
+ },
628
+ // 自定义属性
629
+ properties: {
630
+ type: Object,
631
+ default: () => ({})
632
+ },
633
+ // 层级
634
+ zIndex: {
635
+ type: Number,
636
+ default: 1
637
+ }
638
+ },
639
+ data() {
640
+ return {
641
+ marker: null
642
+ };
643
+ },
644
+ inject: {
645
+ mapInstance: {
646
+ default: null
647
+ }
648
+ },
649
+ mounted() {
650
+ if (this.mapInstance) {
651
+ this.initMarker();
652
+ }
653
+ },
654
+ beforeDestroy() {
655
+ this.removeMarker();
656
+ },
657
+ methods: {
658
+ // 初始化 Marker
659
+ initMarker() {
660
+ const config = {
661
+ coordinates: this.coordinates,
662
+ visible: this.visible,
663
+ draggable: this.draggable,
664
+ curve: this.curve,
665
+ properties: this.properties,
666
+ zIndex: this.zIndex
667
+ };
668
+ if (this.icon) {
669
+ config.symbol = {
670
+ markerFile: this.icon,
671
+ markerWidth: this.iconSize[0],
672
+ markerHeight: this.iconSize[1],
673
+ markerDx: this.iconOffset[0],
674
+ markerDy: this.iconOffset[1],
675
+ markerOpacity: this.opacity,
676
+ markerRotation: this.rotation
677
+ };
678
+ } else {
679
+ config.symbol = {
680
+ markerType: "ellipse",
681
+ markerFill: "#ff0000",
682
+ markerFillOpacity: 1,
683
+ markerLineColor: "#ffffff",
684
+ markerLineWidth: 2,
685
+ markerLineOpacity: 1,
686
+ markerWidth: 30,
687
+ markerHeight: 30,
688
+ markerDx: 0,
689
+ markerDy: 0,
690
+ markerOpacity: this.opacity
691
+ };
692
+ }
693
+ this.marker = new maptalks.Marker(this.coordinates, config);
694
+ this.marker.on("click", this.handleClick);
695
+ this.marker.on("mouseover", this.handleMouseover);
696
+ this.marker.on("mouseout", this.handleMouseout);
697
+ this.marker.on("dragstart", this.handleDragStart);
698
+ this.marker.on("dragging", this.handleDragging);
699
+ this.marker.on("dragend", this.handleDragEnd);
700
+ this.mapInstance.addMarker(this.marker);
701
+ this.$emit("ready", this.marker);
702
+ },
703
+ // 移除 Marker
704
+ removeMarker() {
705
+ if (this.marker && this.mapInstance) {
706
+ this.marker.off("click", this.handleClick);
707
+ this.marker.off("mouseover", this.handleMouseover);
708
+ this.marker.off("mouseout", this.handleMouseout);
709
+ this.marker.off("dragstart", this.handleDragStart);
710
+ this.marker.off("dragging", this.handleDragging);
711
+ this.marker.off("dragend", this.handleDragEnd);
712
+ this.mapInstance.removeMarker(this.marker);
713
+ this.marker = null;
714
+ }
715
+ },
716
+ // 事件处理
717
+ handleClick(e) {
718
+ this.$emit("click", e);
719
+ },
720
+ handleMouseover(e) {
721
+ this.$emit("mouseover", e);
722
+ },
723
+ handleMouseout(e) {
724
+ this.$emit("mouseout", e);
725
+ },
726
+ handleDragStart(e) {
727
+ this.$emit("dragstart", e);
728
+ },
729
+ handleDragging(e) {
730
+ this.$emit("dragging", e);
731
+ },
732
+ handleDragEnd(e) {
733
+ this.$emit("dragend", e);
734
+ },
735
+ // 设置位置
736
+ setCoordinates(coordinates) {
737
+ if (this.marker) {
738
+ this.marker.setCoordinates(coordinates);
739
+ }
740
+ },
741
+ // 设置图标
742
+ setIcon(icon) {
743
+ if (this.marker) {
744
+ this.marker.setSymbol({
745
+ markerFile: icon
746
+ });
747
+ }
748
+ },
749
+ // 设置透明度
750
+ setOpacity(opacity) {
751
+ if (this.marker) {
752
+ this.marker.setOpacity(opacity);
753
+ }
754
+ },
755
+ // 显示
756
+ show() {
757
+ if (this.marker) {
758
+ this.marker.show();
759
+ }
760
+ },
761
+ // 隐藏
762
+ hide() {
763
+ if (this.marker) {
764
+ this.marker.hide();
765
+ }
766
+ },
767
+ // 打开信息窗口
768
+ openInfoWindow(content, options = {}) {
769
+ if (this.marker) {
770
+ this.marker.openInfoWindow(content, options);
771
+ }
772
+ },
773
+ // 关闭信息窗口
774
+ closeInfoWindow() {
775
+ if (this.marker) {
776
+ this.marker.closeInfoWindow();
777
+ }
778
+ },
779
+ // 获取 Marker 实例
780
+ getMarker() {
781
+ return this.marker;
782
+ }
783
+ },
784
+ watch: {
785
+ coordinates(newVal) {
786
+ this.setCoordinates(newVal);
787
+ },
788
+ icon(newVal) {
789
+ this.setIcon(newVal);
790
+ },
791
+ opacity(newVal) {
792
+ this.setOpacity(newVal);
793
+ },
794
+ visible(newVal) {
795
+ if (newVal) {
796
+ this.show();
797
+ } else {
798
+ this.hide();
799
+ }
800
+ }
801
+ }
802
+ };
803
+ var _sfc_render$c = function render5() {
804
+ var _vm = this, _c = _vm._self._c;
805
+ return _c("div", { staticClass: "fy-marker" });
806
+ };
807
+ var _sfc_staticRenderFns$c = [];
808
+ var __component__$c = /* @__PURE__ */ normalizeComponent(
809
+ _sfc_main$c,
810
+ _sfc_render$c,
811
+ _sfc_staticRenderFns$c,
812
+ false,
813
+ null,
814
+ "249684eb"
815
+ );
816
+ const FyMarkerComponent = __component__$c.exports;
817
+ const FyMarker = FyMarkerComponent;
818
+ FyMarker.install = function(Vue) {
819
+ Vue.component(FyMarker.name || "FyMarker", FyMarker);
820
+ };
821
+ const _sfc_main$b = {
822
+ name: "FyLabel",
823
+ props: {
824
+ // 位置坐标 [经度, 纬度]
825
+ coordinates: {
826
+ type: Array,
827
+ required: true
828
+ },
829
+ // 文本内容
830
+ content: {
831
+ type: String,
832
+ required: true
833
+ },
834
+ // 文本框宽度
835
+ boxWidth: {
836
+ type: Number,
837
+ default: 160
838
+ },
839
+ // 文本样式
840
+ textStyle: {
841
+ type: Object,
842
+ default: () => ({
843
+ fontSize: 12,
844
+ fill: "#333",
845
+ weight: "bold"
846
+ })
847
+ },
848
+ // 背景样式
849
+ boxStyle: {
850
+ type: Object,
851
+ default: () => ({
852
+ padding: [4, 4],
853
+ symbol: {
854
+ markerType: "square",
855
+ markerFill: "rgba(255,255,255,0.8)",
856
+ markerFillOpacity: 1,
857
+ markerLineColor: "#ccc",
858
+ markerLineWidth: 1,
859
+ markerLineOpacity: 1,
860
+ markerLineDasharray: [],
861
+ markerWidth: 40,
862
+ markerHeight: 20
863
+ }
864
+ })
865
+ },
866
+ // 透明度
867
+ opacity: {
868
+ type: Number,
869
+ default: 1
870
+ },
871
+ // 可见性
872
+ visible: {
873
+ type: Boolean,
874
+ default: true
875
+ },
876
+ // 文本方向
877
+ textDirection: {
878
+ type: String,
879
+ default: "right"
880
+ // right, left, center
881
+ },
882
+ // 自定义属性
883
+ properties: {
884
+ type: Object,
885
+ default: () => ({})
886
+ },
887
+ // 层级
888
+ zIndex: {
889
+ type: Number,
890
+ default: 10
891
+ }
892
+ },
893
+ data() {
894
+ return {
895
+ label: null
896
+ };
897
+ },
898
+ inject: {
899
+ mapInstance: {
900
+ default: null
901
+ }
902
+ },
903
+ mounted() {
904
+ if (this.mapInstance) {
905
+ this.initLabel();
906
+ }
907
+ },
908
+ beforeDestroy() {
909
+ this.removeLabel();
910
+ },
911
+ methods: {
912
+ // 初始化 Label
913
+ initLabel() {
914
+ const config = {
915
+ coordinates: this.coordinates,
916
+ content: this.content,
917
+ visible: this.visible,
918
+ properties: this.properties,
919
+ zIndex: this.zIndex
920
+ };
921
+ const textSymbol = {
922
+ textName: this.content,
923
+ textSize: this.textStyle.fontSize || 12,
924
+ textFill: this.textStyle.fill || "#333",
925
+ textWeight: this.textStyle.weight || "normal",
926
+ textOpacity: this.opacity,
927
+ textHaloFill: "#ffffff",
928
+ textHaloRadius: 2,
929
+ textHaloOpacity: 1,
930
+ textWrapWidth: this.boxWidth,
931
+ textLineSpacing: 1
932
+ };
933
+ if (this.boxStyle && this.boxStyle.symbol) {
934
+ textSymbol.markerType = this.boxStyle.symbol.markerType || "square";
935
+ textSymbol.markerFill = this.boxStyle.symbol.markerFill || "rgba(255,255,255,0.8)";
936
+ textSymbol.markerFillOpacity = this.boxStyle.symbol.markerFillOpacity || 1;
937
+ textSymbol.markerLineColor = this.boxStyle.symbol.markerLineColor || "#ccc";
938
+ textSymbol.markerLineWidth = this.boxStyle.symbol.markerLineWidth || 1;
939
+ textSymbol.markerLineOpacity = this.boxStyle.symbol.markerLineOpacity || 1;
940
+ textSymbol.markerDx = this.boxStyle.padding && this.boxStyle.padding[0] || 4;
941
+ textSymbol.markerDy = this.boxStyle.padding && this.boxStyle.padding[1] || 4;
942
+ }
943
+ config.symbol = textSymbol;
944
+ this.label = new maptalks.Label(this.content, this.coordinates, config);
945
+ this.label.on("click", this.handleClick);
946
+ this.label.on("mouseover", this.handleMouseover);
947
+ this.label.on("mouseout", this.handleMouseout);
948
+ this.mapInstance.addLabel(this.label);
949
+ this.$emit("ready", this.label);
950
+ },
951
+ // 移除 Label
952
+ removeLabel() {
953
+ if (this.label && this.mapInstance) {
954
+ this.label.off("click", this.handleClick);
955
+ this.label.off("mouseover", this.handleMouseover);
956
+ this.label.off("mouseout", this.handleMouseout);
957
+ this.mapInstance.removeLabel(this.label);
958
+ this.label = null;
959
+ }
960
+ },
961
+ // 事件处理
962
+ handleClick(e) {
963
+ this.$emit("click", e);
964
+ },
965
+ handleMouseover(e) {
966
+ this.$emit("mouseover", e);
967
+ },
968
+ handleMouseout(e) {
969
+ this.$emit("mouseout", e);
970
+ },
971
+ // 设置内容
972
+ setContent(content) {
973
+ if (this.label) {
974
+ this.label.setContent(content);
975
+ }
976
+ },
977
+ // 设置位置
978
+ setCoordinates(coordinates) {
979
+ if (this.label) {
980
+ this.label.setCoordinates(coordinates);
981
+ }
982
+ },
983
+ // 设置样式
984
+ setStyle(style) {
985
+ if (this.label) {
986
+ this.label.setStyle(style);
987
+ }
988
+ },
989
+ // 设置透明度
990
+ setOpacity(opacity) {
991
+ if (this.label) {
992
+ this.label.setOpacity(opacity);
993
+ }
994
+ },
995
+ // 显示
996
+ show() {
997
+ if (this.label) {
998
+ this.label.show();
999
+ }
1000
+ },
1001
+ // 隐藏
1002
+ hide() {
1003
+ if (this.label) {
1004
+ this.label.hide();
1005
+ }
1006
+ },
1007
+ // 获取 Label 实例
1008
+ getLabel() {
1009
+ return this.label;
1010
+ }
1011
+ },
1012
+ watch: {
1013
+ content(newVal) {
1014
+ this.setContent(newVal);
1015
+ },
1016
+ coordinates(newVal) {
1017
+ this.setCoordinates(newVal);
1018
+ },
1019
+ opacity(newVal) {
1020
+ this.setOpacity(newVal);
1021
+ },
1022
+ visible(newVal) {
1023
+ if (newVal) {
1024
+ this.show();
1025
+ } else {
1026
+ this.hide();
1027
+ }
1028
+ }
1029
+ }
1030
+ };
1031
+ var _sfc_render$b = function render6() {
1032
+ var _vm = this, _c = _vm._self._c;
1033
+ return _c("div", { staticClass: "fy-label" });
1034
+ };
1035
+ var _sfc_staticRenderFns$b = [];
1036
+ var __component__$b = /* @__PURE__ */ normalizeComponent(
1037
+ _sfc_main$b,
1038
+ _sfc_render$b,
1039
+ _sfc_staticRenderFns$b,
1040
+ false,
1041
+ null,
1042
+ "2ad8e63e"
1043
+ );
1044
+ const FyLabelComponent = __component__$b.exports;
1045
+ const FyLabel = FyLabelComponent;
1046
+ FyLabel.install = function(Vue) {
1047
+ Vue.component(FyLabel.name || "FyLabel", FyLabel);
1048
+ };
1049
+ const _sfc_main$a = {
1050
+ name: "FyPopup",
1051
+ props: {
1052
+ // 位置坐标 [经度, 纬度]
1053
+ coordinates: {
1054
+ type: Array,
1055
+ required: true
1056
+ },
1057
+ // 弹窗内容
1058
+ content: {
1059
+ type: String,
1060
+ required: true
1061
+ },
1062
+ // 标题
1063
+ title: {
1064
+ type: String,
1065
+ default: ""
1066
+ },
1067
+ // 宽度
1068
+ width: {
1069
+ type: Number,
1070
+ default: 300
1071
+ },
1072
+ // 高度
1073
+ height: {
1074
+ type: Number,
1075
+ default: null
1076
+ },
1077
+ // 最小宽度
1078
+ minWidth: {
1079
+ type: Number,
1080
+ default: 200
1081
+ },
1082
+ // 最小高度
1083
+ minHeight: {
1084
+ type: Number,
1085
+ default: null
1086
+ },
1087
+ // 最大宽度
1088
+ maxWidth: {
1089
+ type: Number,
1090
+ default: 600
1091
+ },
1092
+ // 自动关闭
1093
+ autoClose: {
1094
+ type: Boolean,
1095
+ default: false
1096
+ },
1097
+ // 自定义样式类名
1098
+ className: {
1099
+ type: String,
1100
+ default: ""
1101
+ },
1102
+ // 是否显示关闭按钮
1103
+ closeButton: {
1104
+ type: Boolean,
1105
+ default: true
1106
+ },
1107
+ // 偏移量
1108
+ offset: {
1109
+ type: Array,
1110
+ default: () => [0, 0]
1111
+ },
1112
+ // 自定义属性
1113
+ properties: {
1114
+ type: Object,
1115
+ default: () => ({})
1116
+ }
1117
+ },
1118
+ data() {
1119
+ return {
1120
+ popup: null
1121
+ };
1122
+ },
1123
+ inject: {
1124
+ mapInstance: {
1125
+ default: null
1126
+ }
1127
+ },
1128
+ mounted() {
1129
+ if (this.mapInstance) {
1130
+ this.initPopup();
1131
+ }
1132
+ },
1133
+ beforeDestroy() {
1134
+ this.removePopup();
1135
+ },
1136
+ methods: {
1137
+ // 初始化 Popup
1138
+ initPopup() {
1139
+ const config = {
1140
+ content: this.content,
1141
+ width: this.width,
1142
+ minWidth: this.minWidth,
1143
+ maxWidth: this.maxWidth,
1144
+ autoClose: this.autoClose,
1145
+ className: this.className,
1146
+ closeButton: this.closeButton,
1147
+ offset: this.offset,
1148
+ properties: this.properties
1149
+ };
1150
+ if (this.height !== null) {
1151
+ config.height = this.height;
1152
+ }
1153
+ if (this.minHeight !== null) {
1154
+ config.minHeight = this.minHeight;
1155
+ }
1156
+ if (this.title) {
1157
+ config.title = this.title;
1158
+ }
1159
+ this.popup = new maptalks.InfoWindow(config);
1160
+ this.popup.setCoordinates(this.coordinates);
1161
+ this.popup.on("open", this.handleOpen);
1162
+ this.popup.on("close", this.handleClose);
1163
+ this.popup.on("click", this.handleClick);
1164
+ this.$emit("ready", this.popup);
1165
+ },
1166
+ // 移除 Popup
1167
+ removePopup() {
1168
+ if (this.popup) {
1169
+ this.popup.off("open", this.handleOpen);
1170
+ this.popup.off("close", this.handleClose);
1171
+ this.popup.off("click", this.handleClick);
1172
+ this.popup.remove();
1173
+ this.popup = null;
1174
+ }
1175
+ },
1176
+ // 事件处理
1177
+ handleOpen(e) {
1178
+ this.$emit("open", e);
1179
+ },
1180
+ handleClose(e) {
1181
+ this.$emit("close", e);
1182
+ },
1183
+ handleClick(e) {
1184
+ this.$emit("click", e);
1185
+ },
1186
+ // 显示弹窗
1187
+ show() {
1188
+ if (this.popup && this.mapInstance) {
1189
+ this.mapInstance.openInfoWindow(this.popup, this.coordinates);
1190
+ }
1191
+ },
1192
+ // 隐藏弹窗
1193
+ hide() {
1194
+ if (this.popup) {
1195
+ this.popup.hide();
1196
+ }
1197
+ },
1198
+ // 关闭弹窗
1199
+ close() {
1200
+ if (this.popup) {
1201
+ this.popup.close();
1202
+ }
1203
+ },
1204
+ // 设置内容
1205
+ setContent(content) {
1206
+ if (this.popup) {
1207
+ this.popup.setContent(content);
1208
+ }
1209
+ },
1210
+ // 设置位置
1211
+ setCoordinates(coordinates) {
1212
+ if (this.popup) {
1213
+ this.popup.setCoordinates(coordinates);
1214
+ }
1215
+ },
1216
+ // 设置标题
1217
+ setTitle(title) {
1218
+ if (this.popup) {
1219
+ this.popup.setTitle(title);
1220
+ }
1221
+ },
1222
+ // 设置尺寸
1223
+ setSize(width, height) {
1224
+ if (this.popup) {
1225
+ this.popup.setSize(width, height);
1226
+ }
1227
+ },
1228
+ // 是否打开
1229
+ isOpen() {
1230
+ if (this.popup) {
1231
+ return this.popup.isOpen();
1232
+ }
1233
+ return false;
1234
+ },
1235
+ // 获取 Popup 实例
1236
+ getPopup() {
1237
+ return this.popup;
1238
+ }
1239
+ },
1240
+ watch: {
1241
+ coordinates(newVal) {
1242
+ this.setCoordinates(newVal);
1243
+ },
1244
+ content(newVal) {
1245
+ this.setContent(newVal);
1246
+ },
1247
+ title(newVal) {
1248
+ this.setTitle(newVal);
1249
+ }
1250
+ }
1251
+ };
1252
+ var _sfc_render$a = function render7() {
1253
+ var _vm = this, _c = _vm._self._c;
1254
+ return _c("div", { staticClass: "fy-popup" });
1255
+ };
1256
+ var _sfc_staticRenderFns$a = [];
1257
+ var __component__$a = /* @__PURE__ */ normalizeComponent(
1258
+ _sfc_main$a,
1259
+ _sfc_render$a,
1260
+ _sfc_staticRenderFns$a,
1261
+ false,
1262
+ null,
1263
+ "03c6ffc0"
1264
+ );
1265
+ const FyPopupComponent = __component__$a.exports;
1266
+ const FyPopup = FyPopupComponent;
1267
+ FyPopup.install = function(Vue) {
1268
+ Vue.component(FyPopup.name || "FyPopup", FyPopup);
1269
+ };
1270
+ const _sfc_main$9 = {
1271
+ name: "FyClusterMarker",
1272
+ props: {
1273
+ // Marker 数据数组
1274
+ markers: {
1275
+ type: Array,
1276
+ default: () => []
1277
+ },
1278
+ // 图层ID
1279
+ id: {
1280
+ type: String,
1281
+ default: "cluster-layer"
1282
+ },
1283
+ // 最大缩放级别,超过此级别不再聚合
1284
+ maxZoom: {
1285
+ type: Number,
1286
+ default: 16
1287
+ },
1288
+ // 是否显示文本
1289
+ showText: {
1290
+ type: Boolean,
1291
+ default: true
1292
+ },
1293
+ // 聚合 Marker 样式
1294
+ clusterStyle: {
1295
+ type: Object,
1296
+ default: () => ({
1297
+ symbol: {
1298
+ markerType: "ellipse",
1299
+ markerFill: "#ff0000",
1300
+ markerFillOpacity: 0.6,
1301
+ markerLineColor: "#fff",
1302
+ markerLineWidth: 3,
1303
+ markerLineOpacity: 1
1304
+ },
1305
+ textSize: 14,
1306
+ textFill: "#fff"
1307
+ })
1308
+ },
1309
+ // 单个 Marker 样式
1310
+ markerStyle: {
1311
+ type: Object,
1312
+ default: () => ({
1313
+ symbol: {
1314
+ markerType: "ellipse",
1315
+ markerFill: "#3399ff",
1316
+ markerFillOpacity: 1,
1317
+ markerLineColor: "#fff",
1318
+ markerLineWidth: 2,
1319
+ markerLineOpacity: 1,
1320
+ markerWidth: 24,
1321
+ markerHeight: 24
1322
+ }
1323
+ })
1324
+ },
1325
+ // 图层可见性
1326
+ visible: {
1327
+ type: Boolean,
1328
+ default: true
1329
+ },
1330
+ // 图层透明度
1331
+ opacity: {
1332
+ type: Number,
1333
+ default: 1
1334
+ }
1335
+ },
1336
+ data() {
1337
+ return {
1338
+ layer: null,
1339
+ clusterMarkers: []
1340
+ };
1341
+ },
1342
+ inject: {
1343
+ mapInstance: {
1344
+ default: null
1345
+ }
1346
+ },
1347
+ mounted() {
1348
+ if (this.mapInstance) {
1349
+ this.initClusterLayer();
1350
+ }
1351
+ },
1352
+ beforeDestroy() {
1353
+ this.removeClusterLayer();
1354
+ },
1355
+ methods: {
1356
+ // 初始化聚合图层
1357
+ initClusterLayer() {
1358
+ if (!this.mapInstance || this.markers.length === 0) return;
1359
+ this.layer = new maptalks.VectorLayer(this.id, {
1360
+ visible: this.visible,
1361
+ opacity: this.opacity
1362
+ });
1363
+ this.mapInstance.addLayer(this.layer);
1364
+ this.updateClusterMarkers();
1365
+ this.layer.on("click", this.handleClick);
1366
+ this.$emit("ready", this.layer);
1367
+ },
1368
+ // 更新聚合 Marker
1369
+ updateClusterMarkers() {
1370
+ if (!this.layer) return;
1371
+ this.clearClusterMarkers();
1372
+ const markerList = this.markers.map((item) => {
1373
+ return new maptalks.Marker(item.coordinates, {
1374
+ properties: item.properties || {}
1375
+ });
1376
+ });
1377
+ this.clusterMarkers = new maptalks.ClusterLayer(this.id + "-cluster", markerList, {
1378
+ noClusterWithHowManyPoints: 1,
1379
+ maxZoom: this.maxZoom,
1380
+ symbol: this.getClusterSymbol()
1381
+ });
1382
+ this.mapInstance.addLayer(this.clusterMarkers);
1383
+ this.setupClusterEvents();
1384
+ },
1385
+ // 获取聚合符号
1386
+ getClusterSymbol() {
1387
+ return {
1388
+ markerType: "ellipse",
1389
+ markerFill: "#ff0000",
1390
+ markerFillOpacity: 0.6,
1391
+ markerLineColor: "#fff",
1392
+ markerLineWidth: 3,
1393
+ markerLineOpacity: 1,
1394
+ textFaceName: "sans-serif",
1395
+ textName: "{count}",
1396
+ textFill: "#fff",
1397
+ textSize: 12,
1398
+ textWeight: "bold"
1399
+ };
1400
+ },
1401
+ // 设置聚合事件
1402
+ setupClusterEvents() {
1403
+ if (!this.clusterMarkers) return;
1404
+ this.clusterMarkers.on("click", this.handleClusterClick);
1405
+ this.clusterMarkers.on("mouseover", this.handleClusterMouseover);
1406
+ this.clusterMarkers.on("mouseout", this.handleClusterMouseout);
1407
+ },
1408
+ // 事件处理
1409
+ handleClick(e) {
1410
+ this.$emit("click", e);
1411
+ },
1412
+ handleClusterClick(e) {
1413
+ const cluster = e.target;
1414
+ const markers = cluster.getGeometries();
1415
+ this.$emit("cluster-click", {
1416
+ cluster,
1417
+ markers,
1418
+ coordinates: cluster.getCoordinates(),
1419
+ count: markers.length
1420
+ });
1421
+ if (markers.length > 1 && this.mapInstance.getZoom() < this.maxZoom) {
1422
+ this.mapInstance.fitExtent(cluster.getExtent(), {
1423
+ padding: [50, 50, 50, 50]
1424
+ });
1425
+ }
1426
+ },
1427
+ handleClusterMouseover(e) {
1428
+ const cluster = e.target;
1429
+ const markers = cluster.getGeometries();
1430
+ this.$emit("cluster-mouseover", {
1431
+ cluster,
1432
+ markers,
1433
+ coordinates: cluster.getCoordinates(),
1434
+ count: markers.length
1435
+ });
1436
+ },
1437
+ handleClusterMouseout(e) {
1438
+ const cluster = e.target;
1439
+ const markers = cluster.getGeometries();
1440
+ this.$emit("cluster-mouseout", {
1441
+ cluster,
1442
+ markers,
1443
+ coordinates: cluster.getCoordinates(),
1444
+ count: markers.length
1445
+ });
1446
+ },
1447
+ // 清除聚合 Marker
1448
+ clearClusterMarkers() {
1449
+ if (this.clusterMarkers) {
1450
+ this.clusterMarkers.off("click", this.handleClusterClick);
1451
+ this.clusterMarkers.off("mouseover", this.handleClusterMouseover);
1452
+ this.clusterMarkers.off("mouseout", this.handleClusterMouseout);
1453
+ if (this.mapInstance) {
1454
+ this.mapInstance.removeLayer(this.clusterMarkers);
1455
+ }
1456
+ this.clusterMarkers = null;
1457
+ }
1458
+ },
1459
+ // 移除聚合图层
1460
+ removeClusterLayer() {
1461
+ this.clearClusterMarkers();
1462
+ if (this.layer) {
1463
+ this.layer.off("click", this.handleClick);
1464
+ if (this.mapInstance) {
1465
+ this.mapInstance.removeLayer(this.layer);
1466
+ }
1467
+ this.layer = null;
1468
+ }
1469
+ },
1470
+ // 添加 Marker
1471
+ addMarker(markerData) {
1472
+ this.markers.push(markerData);
1473
+ this.updateClusterMarkers();
1474
+ },
1475
+ // 批量添加 Marker
1476
+ addMarkers(markerDataArray) {
1477
+ this.markers.push(...markerDataArray);
1478
+ this.updateClusterMarkers();
1479
+ },
1480
+ // 移除 Marker
1481
+ removeMarker(markerId) {
1482
+ const index2 = this.markers.findIndex((m) => m.id === markerId);
1483
+ if (index2 > -1) {
1484
+ this.markers.splice(index2, 1);
1485
+ this.updateClusterMarkers();
1486
+ }
1487
+ },
1488
+ // 清空所有 Marker
1489
+ clearMarkers() {
1490
+ this.markers = [];
1491
+ this.updateClusterMarkers();
1492
+ },
1493
+ // 显示图层
1494
+ show() {
1495
+ if (this.layer) {
1496
+ this.layer.show();
1497
+ }
1498
+ if (this.clusterMarkers) {
1499
+ this.clusterMarkers.show();
1500
+ }
1501
+ },
1502
+ // 隐藏图层
1503
+ hide() {
1504
+ if (this.layer) {
1505
+ this.layer.hide();
1506
+ }
1507
+ if (this.clusterMarkers) {
1508
+ this.clusterMarkers.hide();
1509
+ }
1510
+ },
1511
+ // 设置透明度
1512
+ setOpacity(opacity) {
1513
+ if (this.layer) {
1514
+ this.layer.setOpacity(opacity);
1515
+ }
1516
+ if (this.clusterMarkers) {
1517
+ this.clusterMarkers.setOpacity(opacity);
1518
+ }
1519
+ },
1520
+ // 获取图层实例
1521
+ getLayer() {
1522
+ return this.layer;
1523
+ },
1524
+ // 获取聚合实例
1525
+ getCluster() {
1526
+ return this.clusterMarkers;
1527
+ }
1528
+ },
1529
+ watch: {
1530
+ markers: {
1531
+ handler() {
1532
+ this.updateClusterMarkers();
1533
+ },
1534
+ deep: true
1535
+ },
1536
+ visible(newVal) {
1537
+ if (newVal) {
1538
+ this.show();
1539
+ } else {
1540
+ this.hide();
1541
+ }
1542
+ },
1543
+ opacity(newVal) {
1544
+ this.setOpacity(newVal);
1545
+ }
1546
+ }
1547
+ };
1548
+ var _sfc_render$9 = function render8() {
1549
+ var _vm = this, _c = _vm._self._c;
1550
+ return _c("div", { staticClass: "fy-cluster-marker" });
1551
+ };
1552
+ var _sfc_staticRenderFns$9 = [];
1553
+ var __component__$9 = /* @__PURE__ */ normalizeComponent(
1554
+ _sfc_main$9,
1555
+ _sfc_render$9,
1556
+ _sfc_staticRenderFns$9,
1557
+ false,
1558
+ null,
1559
+ "ee36769c"
1560
+ );
1561
+ const FyClusterMarkerComponent = __component__$9.exports;
1562
+ const FyClusterMarker = FyClusterMarkerComponent;
1563
+ FyClusterMarker.install = function(Vue) {
1564
+ Vue.component(FyClusterMarker.name || "FyClusterMarker", FyClusterMarker);
1565
+ };
1566
+ const _sfc_main$8 = {
1567
+ name: "FyDrawTool",
1568
+ props: {
1569
+ // 图层ID
1570
+ layerId: {
1571
+ type: String,
1572
+ default: "draw-layer"
1573
+ },
1574
+ // 默认绘制模式
1575
+ mode: {
1576
+ type: String,
1577
+ default: "none"
1578
+ // point, line, polygon, rectangle, circle, ellipse, none
1579
+ },
1580
+ // 绘制样式
1581
+ symbol: {
1582
+ type: Object,
1583
+ default: () => ({
1584
+ lineColor: "#ff0000",
1585
+ lineWidth: 2,
1586
+ lineOpacity: 0.8,
1587
+ polygonFill: "#ff0000",
1588
+ polygonOpacity: 0.3,
1589
+ markerFill: "#ff0000",
1590
+ markerFillOpacity: 1,
1591
+ markerLineColor: "#ffffff",
1592
+ markerLineWidth: 2,
1593
+ markerLineOpacity: 1,
1594
+ markerWidth: 16,
1595
+ markerHeight: 16
1596
+ })
1597
+ },
1598
+ // 是否允许编辑
1599
+ editable: {
1600
+ type: Boolean,
1601
+ default: true
1602
+ },
1603
+ // 是否允许删除
1604
+ deletable: {
1605
+ type: Boolean,
1606
+ default: true
1607
+ },
1608
+ // 是否显示提示信息
1609
+ showTooltip: {
1610
+ type: Boolean,
1611
+ default: true
1612
+ }
1613
+ },
1614
+ data() {
1615
+ return {
1616
+ layer: null,
1617
+ drawTool: null,
1618
+ isDrawing: false
1619
+ };
1620
+ },
1621
+ inject: {
1622
+ mapInstance: {
1623
+ default: null
1624
+ }
1625
+ },
1626
+ mounted() {
1627
+ if (this.mapInstance) {
1628
+ this.initDrawTool();
1629
+ }
1630
+ },
1631
+ beforeDestroy() {
1632
+ this.removeDrawTool();
1633
+ },
1634
+ methods: {
1635
+ // 初始化绘制工具
1636
+ initDrawTool() {
1637
+ if (!this.mapInstance) return;
1638
+ this.layer = new maptalks.VectorLayer(this.layerId, {
1639
+ enableAltitude: true,
1640
+ altitudeProperty: "altitude"
1641
+ });
1642
+ this.mapInstance.addLayer(this.layer);
1643
+ this.drawTool = new maptalks.DrawTool({
1644
+ mode: this.mode,
1645
+ symbol: this.symbol,
1646
+ once: false,
1647
+ editable: this.editable,
1648
+ autoSurface: true
1649
+ }).addTo(this.mapInstance);
1650
+ this.bindDrawToolEvents();
1651
+ this.$emit("ready", this.drawTool);
1652
+ },
1653
+ // 绑定绘制工具事件
1654
+ bindDrawToolEvents() {
1655
+ if (!this.drawTool) return;
1656
+ this.drawTool.on("drawstart", this.handleDrawStart);
1657
+ this.drawTool.on("drawvertex", this.handleDrawVertex);
1658
+ this.drawTool.on("mousemove", this.handleMouseMove);
1659
+ this.drawTool.on("drawend", this.handleDrawEnd);
1660
+ this.drawTool.on("disable", this.handleDisable);
1661
+ this.drawTool.on("editend", this.handleEditEnd);
1662
+ },
1663
+ // 事件处理
1664
+ handleDrawStart(param) {
1665
+ this.isDrawing = true;
1666
+ this.$emit("drawstart", param);
1667
+ },
1668
+ handleDrawVertex(param) {
1669
+ this.$emit("drawvertex", param);
1670
+ },
1671
+ handleMouseMove(param) {
1672
+ this.$emit("mousemove", param);
1673
+ },
1674
+ handleDrawEnd(param) {
1675
+ this.isDrawing = false;
1676
+ this.$emit("drawend", param);
1677
+ },
1678
+ handleDisable() {
1679
+ this.isDrawing = false;
1680
+ this.$emit("disable");
1681
+ },
1682
+ handleEditEnd(param) {
1683
+ this.$emit("editend", param);
1684
+ },
1685
+ // 设置绘制模式
1686
+ setMode(mode) {
1687
+ if (this.drawTool) {
1688
+ this.drawTool.setMode(mode);
1689
+ }
1690
+ },
1691
+ // 启用绘制
1692
+ enable() {
1693
+ if (this.drawTool) {
1694
+ this.drawTool.enable();
1695
+ }
1696
+ },
1697
+ // 禁用绘制
1698
+ disable() {
1699
+ if (this.drawTool) {
1700
+ this.drawTool.disable();
1701
+ }
1702
+ },
1703
+ // 获取当前模式
1704
+ getMode() {
1705
+ if (this.drawTool) {
1706
+ return this.drawTool.getMode();
1707
+ }
1708
+ return "none";
1709
+ },
1710
+ // 获取当前状态
1711
+ getStatus() {
1712
+ if (this.drawTool) {
1713
+ return this.drawTool.getStatus();
1714
+ }
1715
+ return null;
1716
+ },
1717
+ // 获取当前绘制的图形
1718
+ getCurrentGeometry() {
1719
+ if (this.drawTool) {
1720
+ return this.drawTool.getCurrentGeometry();
1721
+ }
1722
+ return null;
1723
+ },
1724
+ // 获取所有绘制的图形
1725
+ getGeometries() {
1726
+ if (this.layer) {
1727
+ return this.layer.getGeometries();
1728
+ }
1729
+ return [];
1730
+ },
1731
+ // 清除所有图形
1732
+ clear() {
1733
+ if (this.layer) {
1734
+ this.layer.clear();
1735
+ }
1736
+ this.$emit("clear");
1737
+ },
1738
+ // 撤销上一步
1739
+ undo() {
1740
+ if (this.drawTool && this.isDrawing) {
1741
+ this.drawTool.undo();
1742
+ }
1743
+ },
1744
+ // 重做
1745
+ redo() {
1746
+ if (this.drawTool && this.isDrawing) {
1747
+ this.drawTool.redo();
1748
+ }
1749
+ },
1750
+ // 设置符号
1751
+ setSymbol(symbol) {
1752
+ if (this.drawTool) {
1753
+ this.drawTool.setSymbol(symbol);
1754
+ }
1755
+ },
1756
+ // 添加几何图形
1757
+ addGeometry(geometry) {
1758
+ if (this.layer && geometry) {
1759
+ this.layer.addGeometry(geometry);
1760
+ }
1761
+ },
1762
+ // 移除几何图形
1763
+ removeGeometry(geometry) {
1764
+ if (this.layer && geometry) {
1765
+ this.layer.removeGeometry(geometry);
1766
+ }
1767
+ },
1768
+ // 测距
1769
+ measureDistance(coordinates) {
1770
+ if (coordinates && coordinates.length >= 2) {
1771
+ let distance = 0;
1772
+ for (let i = 0; i < coordinates.length - 1; i++) {
1773
+ const p1 = new maptalks.Coordinate(coordinates[i]);
1774
+ const p2 = new maptalks.Coordinate(coordinates[i + 1]);
1775
+ distance += p1.distanceTo(p2);
1776
+ }
1777
+ return distance;
1778
+ }
1779
+ return 0;
1780
+ },
1781
+ // 测面积
1782
+ measureArea(coordinates) {
1783
+ if (coordinates && coordinates.length >= 3) {
1784
+ const polygon = new maptalks.Polygon(coordinates);
1785
+ return polygon.getArea();
1786
+ }
1787
+ return 0;
1788
+ },
1789
+ // 获取绘制工具实例
1790
+ getDrawTool() {
1791
+ return this.drawTool;
1792
+ },
1793
+ // 获取图层实例
1794
+ getLayer() {
1795
+ return this.layer;
1796
+ }
1797
+ },
1798
+ watch: {
1799
+ mode(newVal) {
1800
+ this.setMode(newVal);
1801
+ },
1802
+ symbol: {
1803
+ handler(newVal) {
1804
+ this.setSymbol(newVal);
1805
+ },
1806
+ deep: true
1807
+ }
1808
+ }
1809
+ };
1810
+ var _sfc_render$8 = function render9() {
1811
+ var _vm = this, _c = _vm._self._c;
1812
+ return _c("div", { staticClass: "fy-draw-tool" });
1813
+ };
1814
+ var _sfc_staticRenderFns$8 = [];
1815
+ var __component__$8 = /* @__PURE__ */ normalizeComponent(
1816
+ _sfc_main$8,
1817
+ _sfc_render$8,
1818
+ _sfc_staticRenderFns$8,
1819
+ false,
1820
+ null,
1821
+ "f60f236f"
1822
+ );
1823
+ const FyDrawToolComponent = __component__$8.exports;
1824
+ const FyDrawTool = FyDrawToolComponent;
1825
+ FyDrawTool.install = function(Vue) {
1826
+ Vue.component(FyDrawTool.name || "FyDrawTool", FyDrawTool);
1827
+ };
1828
+ const _sfc_main$7 = {
1829
+ name: "FyDrawPoint",
1830
+ props: {
1831
+ // 图层ID
1832
+ layerId: {
1833
+ type: String,
1834
+ default: "draw-point-layer"
1835
+ },
1836
+ // 点样式
1837
+ symbol: {
1838
+ type: Object,
1839
+ default: () => ({
1840
+ markerType: "ellipse",
1841
+ markerFill: "#ff0000",
1842
+ markerFillOpacity: 1,
1843
+ markerLineColor: "#ffffff",
1844
+ markerLineWidth: 2,
1845
+ markerLineOpacity: 1,
1846
+ markerWidth: 20,
1847
+ markerHeight: 20
1848
+ })
1849
+ },
1850
+ // 是否自动开始绘制
1851
+ autoStart: {
1852
+ type: Boolean,
1853
+ default: true
1854
+ },
1855
+ // 是否显示提示信息
1856
+ showTooltip: {
1857
+ type: Boolean,
1858
+ default: true
1859
+ }
1860
+ },
1861
+ data() {
1862
+ return {
1863
+ layer: null,
1864
+ drawTool: null,
1865
+ points: []
1866
+ };
1867
+ },
1868
+ inject: {
1869
+ mapInstance: {
1870
+ default: null
1871
+ }
1872
+ },
1873
+ mounted() {
1874
+ if (this.mapInstance) {
1875
+ this.initDrawPoint();
1876
+ }
1877
+ },
1878
+ beforeDestroy() {
1879
+ this.removeDrawPoint();
1880
+ },
1881
+ methods: {
1882
+ // 初始化绘制点工具
1883
+ initDrawPoint() {
1884
+ if (!this.mapInstance) return;
1885
+ this.layer = new maptalks.VectorLayer(this.layerId);
1886
+ this.mapInstance.addLayer(this.layer);
1887
+ this.drawTool = new maptalks.DrawTool({
1888
+ mode: "point",
1889
+ symbol: this.symbol,
1890
+ once: true,
1891
+ enableAltitude: true
1892
+ }).addTo(this.mapInstance);
1893
+ this.bindDrawToolEvents();
1894
+ if (this.autoStart) {
1895
+ this.enable();
1896
+ }
1897
+ this.$emit("ready", this.drawTool);
1898
+ },
1899
+ // 绑定绘制工具事件
1900
+ bindDrawToolEvents() {
1901
+ if (!this.drawTool) return;
1902
+ this.drawTool.on("drawstart", this.handleDrawStart);
1903
+ this.drawTool.on("drawend", this.handleDrawEnd);
1904
+ this.drawTool.on("disable", this.handleDisable);
1905
+ },
1906
+ // 事件处理
1907
+ handleDrawStart(param) {
1908
+ this.$emit("drawstart", param);
1909
+ },
1910
+ handleDrawEnd(param) {
1911
+ const point = param.geometry;
1912
+ this.points.push(point);
1913
+ this.$emit("drawend", {
1914
+ point,
1915
+ coordinates: point.getCoordinates(),
1916
+ allPoints: this.points
1917
+ });
1918
+ },
1919
+ handleDisable() {
1920
+ this.$emit("disable");
1921
+ },
1922
+ // 启用绘制
1923
+ enable() {
1924
+ if (this.drawTool) {
1925
+ this.drawTool.enable();
1926
+ }
1927
+ },
1928
+ // 禁用绘制
1929
+ disable() {
1930
+ if (this.drawTool) {
1931
+ this.drawTool.disable();
1932
+ }
1933
+ },
1934
+ // 获取所有绘制的点
1935
+ getPoints() {
1936
+ return this.points;
1937
+ },
1938
+ // 清除所有点
1939
+ clear() {
1940
+ this.points = [];
1941
+ if (this.layer) {
1942
+ this.layer.clear();
1943
+ }
1944
+ this.$emit("clear");
1945
+ },
1946
+ // 添加点
1947
+ addPoint(coordinates) {
1948
+ const point = new maptalks.Marker(coordinates, {
1949
+ symbol: this.symbol
1950
+ });
1951
+ this.layer.addGeometry(point);
1952
+ this.points.push(point);
1953
+ this.$emit("add-point", { point, coordinates });
1954
+ },
1955
+ // 移除点
1956
+ removePoint(index2) {
1957
+ if (index2 >= 0 && index2 < this.points.length) {
1958
+ const point = this.points[index2];
1959
+ this.layer.removeGeometry(point);
1960
+ this.points.splice(index2, 1);
1961
+ this.$emit("remove-point", { point, index: index2 });
1962
+ }
1963
+ },
1964
+ // 设置样式
1965
+ setSymbol(symbol) {
1966
+ if (this.drawTool) {
1967
+ this.drawTool.setSymbol(symbol);
1968
+ }
1969
+ },
1970
+ // 获取绘制工具实例
1971
+ getDrawTool() {
1972
+ return this.drawTool;
1973
+ },
1974
+ // 获取图层实例
1975
+ getLayer() {
1976
+ return this.layer;
1977
+ }
1978
+ }
1979
+ };
1980
+ var _sfc_render$7 = function render10() {
1981
+ var _vm = this, _c = _vm._self._c;
1982
+ return _c("div", { staticClass: "fy-draw-point" });
1983
+ };
1984
+ var _sfc_staticRenderFns$7 = [];
1985
+ var __component__$7 = /* @__PURE__ */ normalizeComponent(
1986
+ _sfc_main$7,
1987
+ _sfc_render$7,
1988
+ _sfc_staticRenderFns$7,
1989
+ false,
1990
+ null,
1991
+ "6fa54668"
1992
+ );
1993
+ const FyDrawPointComponent = __component__$7.exports;
1994
+ const FyDrawPoint = FyDrawPointComponent;
1995
+ FyDrawPoint.install = function(Vue) {
1996
+ Vue.component(FyDrawPoint.name || "FyDrawPoint", FyDrawPoint);
1997
+ };
1998
+ const _sfc_main$6 = {
1999
+ name: "FyDrawLine",
2000
+ props: {
2001
+ // 图层ID
2002
+ layerId: {
2003
+ type: String,
2004
+ default: "draw-line-layer"
2005
+ },
2006
+ // 线样式
2007
+ symbol: {
2008
+ type: Object,
2009
+ default: () => ({
2010
+ lineColor: "#ff0000",
2011
+ lineWidth: 3,
2012
+ lineOpacity: 0.8,
2013
+ lineDasharray: []
2014
+ })
2015
+ },
2016
+ // 是否自动开始绘制
2017
+ autoStart: {
2018
+ type: Boolean,
2019
+ default: true
2020
+ },
2021
+ // 是否显示距离标注
2022
+ showDistance: {
2023
+ type: Boolean,
2024
+ default: true
2025
+ },
2026
+ // 是否显示提示信息
2027
+ showTooltip: {
2028
+ type: Boolean,
2029
+ default: true
2030
+ }
2031
+ },
2032
+ data() {
2033
+ return {
2034
+ layer: null,
2035
+ drawTool: null,
2036
+ lines: []
2037
+ };
2038
+ },
2039
+ inject: {
2040
+ mapInstance: {
2041
+ default: null
2042
+ }
2043
+ },
2044
+ mounted() {
2045
+ if (this.mapInstance) {
2046
+ this.initDrawLine();
2047
+ }
2048
+ },
2049
+ beforeDestroy() {
2050
+ this.removeDrawLine();
2051
+ },
2052
+ methods: {
2053
+ // 初始化绘制线工具
2054
+ initDrawLine() {
2055
+ if (!this.mapInstance) return;
2056
+ this.layer = new maptalks.VectorLayer(this.layerId);
2057
+ this.mapInstance.addLayer(this.layer);
2058
+ this.drawTool = new maptalks.DrawTool({
2059
+ mode: "linestring",
2060
+ symbol: this.symbol,
2061
+ once: true,
2062
+ enableAltitude: true
2063
+ }).addTo(this.mapInstance);
2064
+ this.bindDrawToolEvents();
2065
+ if (this.autoStart) {
2066
+ this.enable();
2067
+ }
2068
+ this.$emit("ready", this.drawTool);
2069
+ },
2070
+ // 绑定绘制工具事件
2071
+ bindDrawToolEvents() {
2072
+ if (!this.drawTool) return;
2073
+ this.drawTool.on("drawstart", this.handleDrawStart);
2074
+ this.drawTool.on("drawend", this.handleDrawEnd);
2075
+ this.drawTool.on("disable", this.handleDisable);
2076
+ },
2077
+ // 事件处理
2078
+ handleDrawStart(param) {
2079
+ this.$emit("drawstart", param);
2080
+ },
2081
+ handleDrawEnd(param) {
2082
+ const line = param.geometry;
2083
+ this.lines.push(line);
2084
+ const result = {
2085
+ line,
2086
+ coordinates: line.getCoordinates(),
2087
+ distance: this.calculateDistance(line.getCoordinates()),
2088
+ allLines: this.lines
2089
+ };
2090
+ if (this.showDistance) {
2091
+ this.addDistanceLabel(line, result.distance);
2092
+ }
2093
+ this.$emit("drawend", result);
2094
+ },
2095
+ handleDisable() {
2096
+ this.$emit("disable");
2097
+ },
2098
+ // 计算距离
2099
+ calculateDistance(coordinates) {
2100
+ if (coordinates && coordinates.length >= 2) {
2101
+ let distance = 0;
2102
+ for (let i = 0; i < coordinates.length - 1; i++) {
2103
+ const p1 = new maptalks.Coordinate(coordinates[i]);
2104
+ const p2 = new maptalks.Coordinate(coordinates[i + 1]);
2105
+ distance += p1.distanceTo(p2);
2106
+ }
2107
+ return distance;
2108
+ }
2109
+ return 0;
2110
+ },
2111
+ // 添加距离标注
2112
+ addDistanceLabel(line, distance) {
2113
+ if (!this.layer) return;
2114
+ const coordinates = line.getCoordinates();
2115
+ const centerIndex = Math.floor(coordinates.length / 2);
2116
+ const center = coordinates[centerIndex];
2117
+ const label = new maptalks.Label(this.formatDistance(distance), center, {
2118
+ boxStyle: {
2119
+ padding: [2, 2],
2120
+ symbol: {
2121
+ markerType: "square",
2122
+ markerFill: "rgba(255,255,255,0.9)",
2123
+ markerLineColor: "#666",
2124
+ markerLineWidth: 1
2125
+ }
2126
+ },
2127
+ textStyle: {
2128
+ fontSize: 12,
2129
+ fill: "#333",
2130
+ weight: "bold"
2131
+ }
2132
+ });
2133
+ this.layer.addGeometry(label);
2134
+ },
2135
+ // 格式化距离
2136
+ formatDistance(distance) {
2137
+ if (distance < 1e3) {
2138
+ return Math.round(distance) + "m";
2139
+ } else {
2140
+ return (distance / 1e3).toFixed(2) + "km";
2141
+ }
2142
+ },
2143
+ // 启用绘制
2144
+ enable() {
2145
+ if (this.drawTool) {
2146
+ this.drawTool.enable();
2147
+ }
2148
+ },
2149
+ // 禁用绘制
2150
+ disable() {
2151
+ if (this.drawTool) {
2152
+ this.drawTool.disable();
2153
+ }
2154
+ },
2155
+ // 获取所有绘制的线
2156
+ getLines() {
2157
+ return this.lines;
2158
+ },
2159
+ // 清除所有线
2160
+ clear() {
2161
+ this.lines = [];
2162
+ if (this.layer) {
2163
+ this.layer.clear();
2164
+ }
2165
+ this.$emit("clear");
2166
+ },
2167
+ // 添加线
2168
+ addLine(coordinates) {
2169
+ const line = new maptalks.LineString(coordinates, {
2170
+ symbol: this.symbol
2171
+ });
2172
+ this.layer.addGeometry(line);
2173
+ this.lines.push(line);
2174
+ const distance = this.calculateDistance(coordinates);
2175
+ if (this.showDistance) {
2176
+ this.addDistanceLabel(line, distance);
2177
+ }
2178
+ this.$emit("add-line", { line, coordinates, distance });
2179
+ },
2180
+ // 移除线
2181
+ removeLine(index2) {
2182
+ if (index2 >= 0 && index2 < this.lines.length) {
2183
+ const line = this.lines[index2];
2184
+ this.layer.removeGeometry(line);
2185
+ this.lines.splice(index2, 1);
2186
+ this.$emit("remove-line", { line, index: index2 });
2187
+ }
2188
+ },
2189
+ // 设置样式
2190
+ setSymbol(symbol) {
2191
+ if (this.drawTool) {
2192
+ this.drawTool.setSymbol(symbol);
2193
+ }
2194
+ },
2195
+ // 获取绘制工具实例
2196
+ getDrawTool() {
2197
+ return this.drawTool;
2198
+ },
2199
+ // 获取图层实例
2200
+ getLayer() {
2201
+ return this.layer;
2202
+ }
2203
+ }
2204
+ };
2205
+ var _sfc_render$6 = function render11() {
2206
+ var _vm = this, _c = _vm._self._c;
2207
+ return _c("div", { staticClass: "fy-draw-line" });
2208
+ };
2209
+ var _sfc_staticRenderFns$6 = [];
2210
+ var __component__$6 = /* @__PURE__ */ normalizeComponent(
2211
+ _sfc_main$6,
2212
+ _sfc_render$6,
2213
+ _sfc_staticRenderFns$6,
2214
+ false,
2215
+ null,
2216
+ "37cf3549"
2217
+ );
2218
+ const FyDrawLineComponent = __component__$6.exports;
2219
+ const FyDrawLine = FyDrawLineComponent;
2220
+ FyDrawLine.install = function(Vue) {
2221
+ Vue.component(FyDrawLine.name || "FyDrawLine", FyDrawLine);
2222
+ };
2223
+ const _sfc_main$5 = {
2224
+ name: "FyDrawPolygon",
2225
+ props: {
2226
+ // 图层ID
2227
+ layerId: {
2228
+ type: String,
2229
+ default: "draw-polygon-layer"
2230
+ },
2231
+ // 面样式
2232
+ symbol: {
2233
+ type: Object,
2234
+ default: () => ({
2235
+ lineColor: "#ff0000",
2236
+ lineWidth: 2,
2237
+ lineOpacity: 0.8,
2238
+ polygonFill: "#ff0000",
2239
+ polygonOpacity: 0.3,
2240
+ lineDasharray: []
2241
+ })
2242
+ },
2243
+ // 是否自动开始绘制
2244
+ autoStart: {
2245
+ type: Boolean,
2246
+ default: true
2247
+ },
2248
+ // 是否显示面积标注
2249
+ showArea: {
2250
+ type: Boolean,
2251
+ default: true
2252
+ },
2253
+ // 是否显示提示信息
2254
+ showTooltip: {
2255
+ type: Boolean,
2256
+ default: true
2257
+ }
2258
+ },
2259
+ data() {
2260
+ return {
2261
+ layer: null,
2262
+ drawTool: null,
2263
+ polygons: []
2264
+ };
2265
+ },
2266
+ inject: {
2267
+ mapInstance: {
2268
+ default: null
2269
+ }
2270
+ },
2271
+ mounted() {
2272
+ if (this.mapInstance) {
2273
+ this.initDrawPolygon();
2274
+ }
2275
+ },
2276
+ beforeDestroy() {
2277
+ this.removeDrawPolygon();
2278
+ },
2279
+ methods: {
2280
+ // 初始化绘制面工具
2281
+ initDrawPolygon() {
2282
+ if (!this.mapInstance) return;
2283
+ this.layer = new maptalks.VectorLayer(this.layerId);
2284
+ this.mapInstance.addLayer(this.layer);
2285
+ this.drawTool = new maptalks.DrawTool({
2286
+ mode: "polygon",
2287
+ symbol: this.symbol,
2288
+ once: true,
2289
+ enableAltitude: true
2290
+ }).addTo(this.mapInstance);
2291
+ this.bindDrawToolEvents();
2292
+ if (this.autoStart) {
2293
+ this.enable();
2294
+ }
2295
+ this.$emit("ready", this.drawTool);
2296
+ },
2297
+ // 绑定绘制工具事件
2298
+ bindDrawToolEvents() {
2299
+ if (!this.drawTool) return;
2300
+ this.drawTool.on("drawstart", this.handleDrawStart);
2301
+ this.drawTool.on("drawend", this.handleDrawEnd);
2302
+ this.drawTool.on("disable", this.handleDisable);
2303
+ },
2304
+ // 事件处理
2305
+ handleDrawStart(param) {
2306
+ this.$emit("drawstart", param);
2307
+ },
2308
+ handleDrawEnd(param) {
2309
+ const polygon = param.geometry;
2310
+ this.polygons.push(polygon);
2311
+ const result = {
2312
+ polygon,
2313
+ coordinates: polygon.getCoordinates(),
2314
+ area: this.calculateArea(polygon),
2315
+ perimeter: this.calculatePerimeter(polygon.getCoordinates()[0]),
2316
+ allPolygons: this.polygons
2317
+ };
2318
+ if (this.showArea) {
2319
+ this.addAreaLabel(polygon, result.area);
2320
+ }
2321
+ this.$emit("drawend", result);
2322
+ },
2323
+ handleDisable() {
2324
+ this.$emit("disable");
2325
+ },
2326
+ // 计算面积
2327
+ calculateArea(polygon) {
2328
+ if (polygon) {
2329
+ return polygon.getArea();
2330
+ }
2331
+ return 0;
2332
+ },
2333
+ // 计算周长
2334
+ calculatePerimeter(coordinates) {
2335
+ if (coordinates && coordinates.length >= 2) {
2336
+ let perimeter = 0;
2337
+ for (let i = 0; i < coordinates.length - 1; i++) {
2338
+ const p1 = new maptalks.Coordinate(coordinates[i]);
2339
+ const p2 = new maptalks.Coordinate(coordinates[i + 1]);
2340
+ perimeter += p1.distanceTo(p2);
2341
+ }
2342
+ return perimeter;
2343
+ }
2344
+ return 0;
2345
+ },
2346
+ // 添加面积标注
2347
+ addAreaLabel(polygon, area) {
2348
+ if (!this.layer) return;
2349
+ const center = polygon.getCenter();
2350
+ const label = new maptalks.Label(this.formatArea(area), center, {
2351
+ boxStyle: {
2352
+ padding: [2, 2],
2353
+ symbol: {
2354
+ markerType: "square",
2355
+ markerFill: "rgba(255,255,255,0.9)",
2356
+ markerLineColor: "#666",
2357
+ markerLineWidth: 1
2358
+ }
2359
+ },
2360
+ textStyle: {
2361
+ fontSize: 12,
2362
+ fill: "#333",
2363
+ weight: "bold"
2364
+ }
2365
+ });
2366
+ this.layer.addGeometry(label);
2367
+ },
2368
+ // 格式化面积
2369
+ formatArea(area) {
2370
+ if (area < 1e6) {
2371
+ return Math.round(area) + "m²";
2372
+ } else {
2373
+ return (area / 1e6).toFixed(2) + "km²";
2374
+ }
2375
+ },
2376
+ // 启用绘制
2377
+ enable() {
2378
+ if (this.drawTool) {
2379
+ this.drawTool.enable();
2380
+ }
2381
+ },
2382
+ // 禁用绘制
2383
+ disable() {
2384
+ if (this.drawTool) {
2385
+ this.drawTool.disable();
2386
+ }
2387
+ },
2388
+ // 获取所有绘制的面
2389
+ getPolygons() {
2390
+ return this.polygons;
2391
+ },
2392
+ // 清除所有面
2393
+ clear() {
2394
+ this.polygons = [];
2395
+ if (this.layer) {
2396
+ this.layer.clear();
2397
+ }
2398
+ this.$emit("clear");
2399
+ },
2400
+ // 添加面
2401
+ addPolygon(coordinates) {
2402
+ const polygon = new maptalks.Polygon(coordinates, {
2403
+ symbol: this.symbol
2404
+ });
2405
+ this.layer.addGeometry(polygon);
2406
+ this.polygons.push(polygon);
2407
+ const area = this.calculateArea(polygon);
2408
+ if (this.showArea) {
2409
+ this.addAreaLabel(polygon, area);
2410
+ }
2411
+ this.$emit("add-polygon", { polygon, coordinates, area });
2412
+ },
2413
+ // 移除面
2414
+ removePolygon(index2) {
2415
+ if (index2 >= 0 && index2 < this.polygons.length) {
2416
+ const polygon = this.polygons[index2];
2417
+ this.layer.removeGeometry(polygon);
2418
+ this.polygons.splice(index2, 1);
2419
+ this.$emit("remove-polygon", { polygon, index: index2 });
2420
+ }
2421
+ },
2422
+ // 设置样式
2423
+ setSymbol(symbol) {
2424
+ if (this.drawTool) {
2425
+ this.drawTool.setSymbol(symbol);
2426
+ }
2427
+ },
2428
+ // 获取绘制工具实例
2429
+ getDrawTool() {
2430
+ return this.drawTool;
2431
+ },
2432
+ // 获取图层实例
2433
+ getLayer() {
2434
+ return this.layer;
2435
+ }
2436
+ }
2437
+ };
2438
+ var _sfc_render$5 = function render12() {
2439
+ var _vm = this, _c = _vm._self._c;
2440
+ return _c("div", { staticClass: "fy-draw-polygon" });
2441
+ };
2442
+ var _sfc_staticRenderFns$5 = [];
2443
+ var __component__$5 = /* @__PURE__ */ normalizeComponent(
2444
+ _sfc_main$5,
2445
+ _sfc_render$5,
2446
+ _sfc_staticRenderFns$5,
2447
+ false,
2448
+ null,
2449
+ "515f74bf"
2450
+ );
2451
+ const FyDrawPolygonComponent = __component__$5.exports;
2452
+ const FyDrawPolygon = FyDrawPolygonComponent;
2453
+ FyDrawPolygon.install = function(Vue) {
2454
+ Vue.component(FyDrawPolygon.name || "FyDrawPolygon", FyDrawPolygon);
2455
+ };
2456
+ const _sfc_main$4 = {
2457
+ name: "FyDrawCircle",
2458
+ props: {
2459
+ // 图层ID
2460
+ layerId: {
2461
+ type: String,
2462
+ default: "draw-circle-layer"
2463
+ },
2464
+ // 圆样式
2465
+ symbol: {
2466
+ type: Object,
2467
+ default: () => ({
2468
+ lineColor: "#ff0000",
2469
+ lineWidth: 2,
2470
+ lineOpacity: 0.8,
2471
+ polygonFill: "#ff0000",
2472
+ polygonOpacity: 0.3
2473
+ })
2474
+ },
2475
+ // 是否自动开始绘制
2476
+ autoStart: {
2477
+ type: Boolean,
2478
+ default: true
2479
+ },
2480
+ // 是否显示半径和面积标注
2481
+ showLabels: {
2482
+ type: Boolean,
2483
+ default: true
2484
+ },
2485
+ // 是否显示提示信息
2486
+ showTooltip: {
2487
+ type: Boolean,
2488
+ default: true
2489
+ }
2490
+ },
2491
+ data() {
2492
+ return {
2493
+ layer: null,
2494
+ drawTool: null,
2495
+ circles: []
2496
+ };
2497
+ },
2498
+ inject: {
2499
+ mapInstance: {
2500
+ default: null
2501
+ }
2502
+ },
2503
+ mounted() {
2504
+ if (this.mapInstance) {
2505
+ this.initDrawCircle();
2506
+ }
2507
+ },
2508
+ beforeDestroy() {
2509
+ this.removeDrawCircle();
2510
+ },
2511
+ methods: {
2512
+ // 初始化绘制圆工具
2513
+ initDrawCircle() {
2514
+ if (!this.mapInstance) return;
2515
+ this.layer = new maptalks.VectorLayer(this.layerId);
2516
+ this.mapInstance.addLayer(this.layer);
2517
+ this.drawTool = new maptalks.DrawTool({
2518
+ mode: "circle",
2519
+ symbol: this.symbol,
2520
+ once: true,
2521
+ enableAltitude: true
2522
+ }).addTo(this.mapInstance);
2523
+ this.bindDrawToolEvents();
2524
+ if (this.autoStart) {
2525
+ this.enable();
2526
+ }
2527
+ this.$emit("ready", this.drawTool);
2528
+ },
2529
+ // 绑定绘制工具事件
2530
+ bindDrawToolEvents() {
2531
+ if (!this.drawTool) return;
2532
+ this.drawTool.on("drawstart", this.handleDrawStart);
2533
+ this.drawTool.on("drawend", this.handleDrawEnd);
2534
+ this.drawTool.on("disable", this.handleDisable);
2535
+ },
2536
+ // 事件处理
2537
+ handleDrawStart(param) {
2538
+ this.$emit("drawstart", param);
2539
+ },
2540
+ handleDrawEnd(param) {
2541
+ const circle = param.geometry;
2542
+ this.circles.push(circle);
2543
+ const result = {
2544
+ circle,
2545
+ center: circle.getCoordinates(),
2546
+ radius: this.calculateRadius(circle),
2547
+ area: this.calculateArea(circle),
2548
+ perimeter: this.calculatePerimeter(circle),
2549
+ allCircles: this.circles
2550
+ };
2551
+ if (this.showLabels) {
2552
+ this.addCircleLabels(circle, result.radius, result.area);
2553
+ }
2554
+ this.$emit("drawend", result);
2555
+ },
2556
+ handleDisable() {
2557
+ this.$emit("disable");
2558
+ },
2559
+ // 计算半径
2560
+ calculateRadius(circle) {
2561
+ if (circle) {
2562
+ return circle.getRadius();
2563
+ }
2564
+ return 0;
2565
+ },
2566
+ // 计算面积
2567
+ calculateArea(circle) {
2568
+ if (circle) {
2569
+ return circle.getArea();
2570
+ }
2571
+ return 0;
2572
+ },
2573
+ // 计算周长
2574
+ calculatePerimeter(circle) {
2575
+ if (circle) {
2576
+ const radius = circle.getRadius();
2577
+ return 2 * Math.PI * radius;
2578
+ }
2579
+ return 0;
2580
+ },
2581
+ // 添加圆的标注
2582
+ addCircleLabels(circle, radius, area) {
2583
+ if (!this.layer) return;
2584
+ const center = circle.getCoordinates();
2585
+ const radiusLabel = new maptalks.Label(this.formatDistance(radius), center, {
2586
+ boxStyle: {
2587
+ padding: [2, 2],
2588
+ symbol: {
2589
+ markerType: "square",
2590
+ markerFill: "rgba(255,255,255,0.9)",
2591
+ markerLineColor: "#666",
2592
+ markerLineWidth: 1
2593
+ }
2594
+ },
2595
+ textStyle: {
2596
+ fontSize: 12,
2597
+ fill: "#333",
2598
+ weight: "bold"
2599
+ }
2600
+ });
2601
+ this.layer.addGeometry(radiusLabel);
2602
+ const angle = Math.PI / 4;
2603
+ const labelCoords = {
2604
+ x: center.x + radius * Math.cos(angle),
2605
+ y: center.y + radius * Math.sin(angle)
2606
+ };
2607
+ const areaLabel = new maptalks.Label(this.formatArea(area), labelCoords, {
2608
+ boxStyle: {
2609
+ padding: [2, 2],
2610
+ symbol: {
2611
+ markerType: "square",
2612
+ markerFill: "rgba(255,255,255,0.9)",
2613
+ markerLineColor: "#666",
2614
+ markerLineWidth: 1
2615
+ }
2616
+ },
2617
+ textStyle: {
2618
+ fontSize: 11,
2619
+ fill: "#666",
2620
+ weight: "normal"
2621
+ }
2622
+ });
2623
+ this.layer.addGeometry(areaLabel);
2624
+ },
2625
+ // 格式化距离
2626
+ formatDistance(distance) {
2627
+ if (distance < 1e3) {
2628
+ return Math.round(distance) + "m";
2629
+ } else {
2630
+ return (distance / 1e3).toFixed(2) + "km";
2631
+ }
2632
+ },
2633
+ // 格式化面积
2634
+ formatArea(area) {
2635
+ if (area < 1e6) {
2636
+ return Math.round(area) + "m²";
2637
+ } else {
2638
+ return (area / 1e6).toFixed(2) + "km²";
2639
+ }
2640
+ },
2641
+ // 启用绘制
2642
+ enable() {
2643
+ if (this.drawTool) {
2644
+ this.drawTool.enable();
2645
+ }
2646
+ },
2647
+ // 禁用绘制
2648
+ disable() {
2649
+ if (this.drawTool) {
2650
+ this.drawTool.disable();
2651
+ }
2652
+ },
2653
+ // 获取所有绘制的圆
2654
+ getCircles() {
2655
+ return this.circles;
2656
+ },
2657
+ // 清除所有圆
2658
+ clear() {
2659
+ this.circles = [];
2660
+ if (this.layer) {
2661
+ this.layer.clear();
2662
+ }
2663
+ this.$emit("clear");
2664
+ },
2665
+ // 添加圆
2666
+ addCircle(center, radius) {
2667
+ const circle = new maptalks.Circle(center, radius, {
2668
+ symbol: this.symbol
2669
+ });
2670
+ this.layer.addGeometry(circle);
2671
+ this.circles.push(circle);
2672
+ const area = this.calculateArea(circle);
2673
+ if (this.showLabels) {
2674
+ this.addCircleLabels(circle, radius, area);
2675
+ }
2676
+ this.$emit("add-circle", { circle, center, radius, area });
2677
+ },
2678
+ // 移除圆
2679
+ removeCircle(index2) {
2680
+ if (index2 >= 0 && index2 < this.circles.length) {
2681
+ const circle = this.circles[index2];
2682
+ this.layer.removeGeometry(circle);
2683
+ this.circles.splice(index2, 1);
2684
+ this.$emit("remove-circle", { circle, index: index2 });
2685
+ }
2686
+ },
2687
+ // 设置样式
2688
+ setSymbol(symbol) {
2689
+ if (this.drawTool) {
2690
+ this.drawTool.setSymbol(symbol);
2691
+ }
2692
+ },
2693
+ // 获取绘制工具实例
2694
+ getDrawTool() {
2695
+ return this.drawTool;
2696
+ },
2697
+ // 获取图层实例
2698
+ getLayer() {
2699
+ return this.layer;
2700
+ }
2701
+ }
2702
+ };
2703
+ var _sfc_render$4 = function render13() {
2704
+ var _vm = this, _c = _vm._self._c;
2705
+ return _c("div", { staticClass: "fy-draw-circle" });
2706
+ };
2707
+ var _sfc_staticRenderFns$4 = [];
2708
+ var __component__$4 = /* @__PURE__ */ normalizeComponent(
2709
+ _sfc_main$4,
2710
+ _sfc_render$4,
2711
+ _sfc_staticRenderFns$4,
2712
+ false,
2713
+ null,
2714
+ "93e35e4d"
2715
+ );
2716
+ const FyDrawCircleComponent = __component__$4.exports;
2717
+ const FyDrawCircle = FyDrawCircleComponent;
2718
+ FyDrawCircle.install = function(Vue) {
2719
+ Vue.component(FyDrawCircle.name || "FyDrawCircle", FyDrawCircle);
2720
+ };
2721
+ const _sfc_main$3 = {
2722
+ name: "FyPoint",
2723
+ props: {
2724
+ // 位置坐标 [经度, 纬度]
2725
+ coordinates: {
2726
+ type: Array,
2727
+ required: true
2728
+ },
2729
+ // 图层ID
2730
+ layerId: {
2731
+ type: String,
2732
+ default: "point-layer"
2733
+ },
2734
+ // 点样式
2735
+ symbol: {
2736
+ type: Object,
2737
+ default: () => ({
2738
+ markerType: "ellipse",
2739
+ markerFill: "#ff0000",
2740
+ markerFillOpacity: 1,
2741
+ markerLineColor: "#ffffff",
2742
+ markerLineWidth: 2,
2743
+ markerLineOpacity: 1,
2744
+ markerWidth: 24,
2745
+ markerHeight: 24,
2746
+ markerDx: 0,
2747
+ markerDy: 0
2748
+ })
2749
+ },
2750
+ // 透明度
2751
+ opacity: {
2752
+ type: Number,
2753
+ default: 1
2754
+ },
2755
+ // 可见性
2756
+ visible: {
2757
+ type: Boolean,
2758
+ default: true
2759
+ },
2760
+ // 层级
2761
+ zIndex: {
2762
+ type: Number,
2763
+ default: 10
2764
+ },
2765
+ // 自定义属性
2766
+ properties: {
2767
+ type: Object,
2768
+ default: () => ({})
2769
+ }
2770
+ },
2771
+ data() {
2772
+ return {
2773
+ layer: null,
2774
+ point: null
2775
+ };
2776
+ },
2777
+ inject: {
2778
+ mapInstance: {
2779
+ default: null
2780
+ }
2781
+ },
2782
+ mounted() {
2783
+ if (this.mapInstance) {
2784
+ this.initPoint();
2785
+ }
2786
+ },
2787
+ beforeDestroy() {
2788
+ this.removePoint();
2789
+ },
2790
+ methods: {
2791
+ // 初始化点
2792
+ initPoint() {
2793
+ if (!this.mapInstance) return;
2794
+ this.layer = this.mapInstance.getLayer(this.layerId);
2795
+ if (!this.layer) {
2796
+ this.layer = new maptalks.VectorLayer(this.layerId, {
2797
+ zIndex: this.zIndex
2798
+ });
2799
+ this.mapInstance.addLayer(this.layer);
2800
+ }
2801
+ const config = {
2802
+ symbol: this.symbol,
2803
+ visible: this.visible,
2804
+ opacity: this.opacity,
2805
+ properties: this.properties,
2806
+ zIndex: this.zIndex
2807
+ };
2808
+ this.point = new maptalks.Marker(this.coordinates, config);
2809
+ this.point.on("click", this.handleClick);
2810
+ this.point.on("mouseover", this.handleMouseover);
2811
+ this.point.on("mouseout", this.handleMouseout);
2812
+ this.point.on("dblclick", this.handleDblClick);
2813
+ this.point.on("mousedown", this.handleMouseDown);
2814
+ this.point.on("mouseup", this.handleMouseUp);
2815
+ this.layer.addGeometry(this.point);
2816
+ this.$emit("ready", this.point);
2817
+ },
2818
+ // 移除点
2819
+ removePoint() {
2820
+ if (this.point && this.layer) {
2821
+ this.point.off("click", this.handleClick);
2822
+ this.point.off("mouseover", this.handleMouseover);
2823
+ this.point.off("mouseout", this.handleMouseout);
2824
+ this.point.off("dblclick", this.handleDblClick);
2825
+ this.point.off("mousedown", this.handleMouseDown);
2826
+ this.point.off("mouseup", this.handleMouseUp);
2827
+ this.layer.removeGeometry(this.point);
2828
+ this.point = null;
2829
+ }
2830
+ },
2831
+ // 事件处理
2832
+ handleClick(e) {
2833
+ this.$emit("click", e);
2834
+ },
2835
+ handleMouseover(e) {
2836
+ this.$emit("mouseover", e);
2837
+ },
2838
+ handleMouseout(e) {
2839
+ this.$emit("mouseout", e);
2840
+ },
2841
+ handleDblClick(e) {
2842
+ this.$emit("dblclick", e);
2843
+ },
2844
+ handleMouseDown(e) {
2845
+ this.$emit("mousedown", e);
2846
+ },
2847
+ handleMouseUp(e) {
2848
+ this.$emit("mouseup", e);
2849
+ },
2850
+ // 设置位置
2851
+ setCoordinates(coordinates) {
2852
+ if (this.point) {
2853
+ this.point.setCoordinates(coordinates);
2854
+ }
2855
+ },
2856
+ // 设置样式
2857
+ setSymbol(symbol) {
2858
+ if (this.point) {
2859
+ this.point.setSymbol(symbol);
2860
+ }
2861
+ },
2862
+ // 设置透明度
2863
+ setOpacity(opacity) {
2864
+ if (this.point) {
2865
+ this.point.setOpacity(opacity);
2866
+ }
2867
+ },
2868
+ // 显示
2869
+ show() {
2870
+ if (this.point) {
2871
+ this.point.show();
2872
+ }
2873
+ },
2874
+ // 隐藏
2875
+ hide() {
2876
+ if (this.point) {
2877
+ this.point.hide();
2878
+ }
2879
+ },
2880
+ // 动画到指定位置
2881
+ animateTo(coordinates, options = {}) {
2882
+ if (this.point) {
2883
+ this.point.animateTo(
2884
+ {
2885
+ coordinates
2886
+ },
2887
+ options
2888
+ );
2889
+ }
2890
+ },
2891
+ // 获取坐标
2892
+ getCoordinates() {
2893
+ if (this.point) {
2894
+ return this.point.getCoordinates();
2895
+ }
2896
+ return null;
2897
+ },
2898
+ // 获取点实例
2899
+ getPoint() {
2900
+ return this.point;
2901
+ },
2902
+ // 获取图层实例
2903
+ getLayer() {
2904
+ return this.layer;
2905
+ }
2906
+ },
2907
+ watch: {
2908
+ coordinates(newVal) {
2909
+ this.setCoordinates(newVal);
2910
+ },
2911
+ symbol: {
2912
+ handler(newVal) {
2913
+ this.setSymbol(newVal);
2914
+ },
2915
+ deep: true
2916
+ },
2917
+ opacity(newVal) {
2918
+ this.setOpacity(newVal);
2919
+ },
2920
+ visible(newVal) {
2921
+ if (newVal) {
2922
+ this.show();
2923
+ } else {
2924
+ this.hide();
2925
+ }
2926
+ }
2927
+ }
2928
+ };
2929
+ var _sfc_render$3 = function render14() {
2930
+ var _vm = this, _c = _vm._self._c;
2931
+ return _c("div", { staticClass: "fy-point" });
2932
+ };
2933
+ var _sfc_staticRenderFns$3 = [];
2934
+ var __component__$3 = /* @__PURE__ */ normalizeComponent(
2935
+ _sfc_main$3,
2936
+ _sfc_render$3,
2937
+ _sfc_staticRenderFns$3,
2938
+ false,
2939
+ null,
2940
+ "9191aada"
2941
+ );
2942
+ const FyPointComponent = __component__$3.exports;
2943
+ const FyPoint = FyPointComponent;
2944
+ FyPoint.install = function(Vue) {
2945
+ Vue.component(FyPoint.name || "FyPoint", FyPoint);
2946
+ };
2947
+ const _sfc_main$2 = {
2948
+ name: "FyLineString",
2949
+ props: {
2950
+ // 线的坐标数组 [[经度, 纬度], ...]
2951
+ coordinates: {
2952
+ type: Array,
2953
+ required: true
2954
+ },
2955
+ // 图层ID
2956
+ layerId: {
2957
+ type: String,
2958
+ default: "linestring-layer"
2959
+ },
2960
+ // 线样式
2961
+ symbol: {
2962
+ type: Object,
2963
+ default: () => ({
2964
+ lineColor: "#3388ff",
2965
+ lineWidth: 3,
2966
+ lineOpacity: 0.8,
2967
+ lineDasharray: [],
2968
+ lineCap: "butt",
2969
+ // butt, round, square
2970
+ lineJoin: "miter"
2971
+ // mitre, round, bevel
2972
+ })
2973
+ },
2974
+ // 透明度
2975
+ opacity: {
2976
+ type: Number,
2977
+ default: 1
2978
+ },
2979
+ // 可见性
2980
+ visible: {
2981
+ type: Boolean,
2982
+ default: true
2983
+ },
2984
+ // 层级
2985
+ zIndex: {
2986
+ type: Number,
2987
+ default: 10
2988
+ },
2989
+ // 是否平滑曲线
2990
+ smooth: {
2991
+ type: Boolean,
2992
+ default: false
2993
+ },
2994
+ // 自定义属性
2995
+ properties: {
2996
+ type: Object,
2997
+ default: () => ({})
2998
+ }
2999
+ },
3000
+ data() {
3001
+ return {
3002
+ layer: null,
3003
+ lineString: null
3004
+ };
3005
+ },
3006
+ inject: {
3007
+ mapInstance: {
3008
+ default: null
3009
+ }
3010
+ },
3011
+ mounted() {
3012
+ if (this.mapInstance) {
3013
+ this.initLineString();
3014
+ }
3015
+ },
3016
+ beforeDestroy() {
3017
+ this.removeLineString();
3018
+ },
3019
+ methods: {
3020
+ // 初始化线
3021
+ initLineString() {
3022
+ if (!this.mapInstance) return;
3023
+ this.layer = this.mapInstance.getLayer(this.layerId);
3024
+ if (!this.layer) {
3025
+ this.layer = new maptalks.VectorLayer(this.layerId, {
3026
+ zIndex: this.zIndex
3027
+ });
3028
+ this.mapInstance.addLayer(this.layer);
3029
+ }
3030
+ const config = {
3031
+ symbol: this.symbol,
3032
+ visible: this.visible,
3033
+ opacity: this.opacity,
3034
+ properties: this.properties,
3035
+ zIndex: this.zIndex
3036
+ };
3037
+ this.lineString = new maptalks.LineString(this.coordinates, config);
3038
+ this.lineString.on("click", this.handleClick);
3039
+ this.lineString.on("mouseover", this.handleMouseover);
3040
+ this.lineString.on("mouseout", this.handleMouseout);
3041
+ this.lineString.on("dblclick", this.handleDblClick);
3042
+ this.lineString.on("mousedown", this.handleMouseDown);
3043
+ this.lineString.on("mouseup", this.handleMouseUp);
3044
+ this.layer.addGeometry(this.lineString);
3045
+ this.$emit("ready", this.lineString);
3046
+ },
3047
+ // 移除线
3048
+ removeLineString() {
3049
+ if (this.lineString && this.layer) {
3050
+ this.lineString.off("click", this.handleClick);
3051
+ this.lineString.off("mouseover", this.handleMouseover);
3052
+ this.lineString.off("mouseout", this.handleMouseout);
3053
+ this.lineString.off("dblclick", this.handleDblClick);
3054
+ this.lineString.off("mousedown", this.handleMouseDown);
3055
+ this.lineString.off("mouseup", this.handleMouseUp);
3056
+ this.layer.removeGeometry(this.lineString);
3057
+ this.lineString = null;
3058
+ }
3059
+ },
3060
+ // 事件处理
3061
+ handleClick(e) {
3062
+ this.$emit("click", e);
3063
+ },
3064
+ handleMouseover(e) {
3065
+ this.$emit("mouseover", e);
3066
+ },
3067
+ handleMouseout(e) {
3068
+ this.$emit("mouseout", e);
3069
+ },
3070
+ handleDblClick(e) {
3071
+ this.$emit("dblclick", e);
3072
+ },
3073
+ handleMouseDown(e) {
3074
+ this.$emit("mousedown", e);
3075
+ },
3076
+ handleMouseUp(e) {
3077
+ this.$emit("mouseup", e);
3078
+ },
3079
+ // 设置坐标
3080
+ setCoordinates(coordinates) {
3081
+ if (this.lineString) {
3082
+ this.lineString.setCoordinates(coordinates);
3083
+ }
3084
+ },
3085
+ // 添加坐标点
3086
+ appendCoordinates(coordinates) {
3087
+ if (this.lineString) {
3088
+ this.lineString.appendCoordinates(coordinates);
3089
+ }
3090
+ },
3091
+ // 移除坐标点
3092
+ removeCoordinates(index2, count = 1) {
3093
+ if (this.lineString) {
3094
+ this.lineString.removeCoordinates(index2, count);
3095
+ }
3096
+ },
3097
+ // 插入坐标点
3098
+ insertCoordinates(index2, coordinates) {
3099
+ if (this.lineString) {
3100
+ this.lineString.insertCoordinates(index2, coordinates);
3101
+ }
3102
+ },
3103
+ // 设置样式
3104
+ setSymbol(symbol) {
3105
+ if (this.lineString) {
3106
+ this.lineString.setSymbol(symbol);
3107
+ }
3108
+ },
3109
+ // 设置透明度
3110
+ setOpacity(opacity) {
3111
+ if (this.lineString) {
3112
+ this.lineString.setOpacity(opacity);
3113
+ }
3114
+ },
3115
+ // 显示
3116
+ show() {
3117
+ if (this.lineString) {
3118
+ this.lineString.show();
3119
+ }
3120
+ },
3121
+ // 隐藏
3122
+ hide() {
3123
+ if (this.lineString) {
3124
+ this.lineString.hide();
3125
+ }
3126
+ },
3127
+ // 获取长度
3128
+ getLength() {
3129
+ if (this.lineString) {
3130
+ return this.lineString.getLength();
3131
+ }
3132
+ return 0;
3133
+ },
3134
+ // 获取坐标
3135
+ getCoordinates() {
3136
+ if (this.lineString) {
3137
+ return this.lineString.getCoordinates();
3138
+ }
3139
+ return [];
3140
+ },
3141
+ // 获取中心点
3142
+ getCenter() {
3143
+ if (this.lineString) {
3144
+ return this.lineString.getCenter();
3145
+ }
3146
+ return null;
3147
+ },
3148
+ // 获取范围
3149
+ getExtent() {
3150
+ if (this.lineString) {
3151
+ return this.lineString.getExtent();
3152
+ }
3153
+ return null;
3154
+ },
3155
+ // 获取线实例
3156
+ getLineString() {
3157
+ return this.lineString;
3158
+ },
3159
+ // 获取图层实例
3160
+ getLayer() {
3161
+ return this.layer;
3162
+ }
3163
+ },
3164
+ watch: {
3165
+ coordinates(newVal) {
3166
+ this.setCoordinates(newVal);
3167
+ },
3168
+ symbol: {
3169
+ handler(newVal) {
3170
+ this.setSymbol(newVal);
3171
+ },
3172
+ deep: true
3173
+ },
3174
+ opacity(newVal) {
3175
+ this.setOpacity(newVal);
3176
+ },
3177
+ visible(newVal) {
3178
+ if (newVal) {
3179
+ this.show();
3180
+ } else {
3181
+ this.hide();
3182
+ }
3183
+ }
3184
+ }
3185
+ };
3186
+ var _sfc_render$2 = function render15() {
3187
+ var _vm = this, _c = _vm._self._c;
3188
+ return _c("div", { staticClass: "fy-linestring" });
3189
+ };
3190
+ var _sfc_staticRenderFns$2 = [];
3191
+ var __component__$2 = /* @__PURE__ */ normalizeComponent(
3192
+ _sfc_main$2,
3193
+ _sfc_render$2,
3194
+ _sfc_staticRenderFns$2,
3195
+ false,
3196
+ null,
3197
+ "f5afe3b1"
3198
+ );
3199
+ const FyLineStringComponent = __component__$2.exports;
3200
+ const FyLineString = FyLineStringComponent;
3201
+ FyLineString.install = function(Vue) {
3202
+ Vue.component(FyLineString.name || "FyLineString", FyLineString);
3203
+ };
3204
+ const _sfc_main$1 = {
3205
+ name: "FyPolygon",
3206
+ props: {
3207
+ // 多边形的坐标数组 [[[经度, 纬度], ...], ...]
3208
+ coordinates: {
3209
+ type: Array,
3210
+ required: true
3211
+ },
3212
+ // 图层ID
3213
+ layerId: {
3214
+ type: String,
3215
+ default: "polygon-layer"
3216
+ },
3217
+ // 多边形样式
3218
+ symbol: {
3219
+ type: Object,
3220
+ default: () => ({
3221
+ lineColor: "#3388ff",
3222
+ lineWidth: 2,
3223
+ lineOpacity: 0.8,
3224
+ polygonFill: "#3388ff",
3225
+ polygonOpacity: 0.3,
3226
+ lineDasharray: []
3227
+ })
3228
+ },
3229
+ // 透明度
3230
+ opacity: {
3231
+ type: Number,
3232
+ default: 1
3233
+ },
3234
+ // 可见性
3235
+ visible: {
3236
+ type: Boolean,
3237
+ default: true
3238
+ },
3239
+ // 层级
3240
+ zIndex: {
3241
+ type: Number,
3242
+ default: 10
3243
+ },
3244
+ // 自定义属性
3245
+ properties: {
3246
+ type: Object,
3247
+ default: () => ({})
3248
+ }
3249
+ },
3250
+ data() {
3251
+ return {
3252
+ layer: null,
3253
+ polygon: null
3254
+ };
3255
+ },
3256
+ inject: {
3257
+ mapInstance: {
3258
+ default: null
3259
+ }
3260
+ },
3261
+ mounted() {
3262
+ if (this.mapInstance) {
3263
+ this.initPolygon();
3264
+ }
3265
+ },
3266
+ beforeDestroy() {
3267
+ this.removePolygon();
3268
+ },
3269
+ methods: {
3270
+ // 初始化多边形
3271
+ initPolygon() {
3272
+ if (!this.mapInstance) return;
3273
+ this.layer = this.mapInstance.getLayer(this.layerId);
3274
+ if (!this.layer) {
3275
+ this.layer = new maptalks.VectorLayer(this.layerId, {
3276
+ zIndex: this.zIndex
3277
+ });
3278
+ this.mapInstance.addLayer(this.layer);
3279
+ }
3280
+ const config = {
3281
+ symbol: this.symbol,
3282
+ visible: this.visible,
3283
+ opacity: this.opacity,
3284
+ properties: this.properties,
3285
+ zIndex: this.zIndex
3286
+ };
3287
+ this.polygon = new maptalks.Polygon(this.coordinates, config);
3288
+ this.polygon.on("click", this.handleClick);
3289
+ this.polygon.on("mouseover", this.handleMouseover);
3290
+ this.polygon.on("mouseout", this.handleMouseout);
3291
+ this.polygon.on("dblclick", this.handleDblClick);
3292
+ this.polygon.on("mousedown", this.handleMouseDown);
3293
+ this.polygon.on("mouseup", this.handleMouseUp);
3294
+ this.layer.addGeometry(this.polygon);
3295
+ this.$emit("ready", this.polygon);
3296
+ },
3297
+ // 移除多边形
3298
+ removePolygon() {
3299
+ if (this.polygon && this.layer) {
3300
+ this.polygon.off("click", this.handleClick);
3301
+ this.polygon.off("mouseover", this.handleMouseover);
3302
+ this.polygon.off("mouseout", this.handleMouseout);
3303
+ this.polygon.off("dblclick", this.handleDblClick);
3304
+ this.polygon.off("mousedown", this.handleMouseDown);
3305
+ this.polygon.off("mouseup", this.handleMouseUp);
3306
+ this.layer.removeGeometry(this.polygon);
3307
+ this.polygon = null;
3308
+ }
3309
+ },
3310
+ // 事件处理
3311
+ handleClick(e) {
3312
+ this.$emit("click", e);
3313
+ },
3314
+ handleMouseover(e) {
3315
+ this.$emit("mouseover", e);
3316
+ },
3317
+ handleMouseout(e) {
3318
+ this.$emit("mouseout", e);
3319
+ },
3320
+ handleDblClick(e) {
3321
+ this.$emit("dblclick", e);
3322
+ },
3323
+ handleMouseDown(e) {
3324
+ this.$emit("mousedown", e);
3325
+ },
3326
+ handleMouseUp(e) {
3327
+ this.$emit("mouseup", e);
3328
+ },
3329
+ // 设置坐标
3330
+ setCoordinates(coordinates) {
3331
+ if (this.polygon) {
3332
+ this.polygon.setCoordinates(coordinates);
3333
+ }
3334
+ },
3335
+ // 设置样式
3336
+ setSymbol(symbol) {
3337
+ if (this.polygon) {
3338
+ this.polygon.setSymbol(symbol);
3339
+ }
3340
+ },
3341
+ // 设置透明度
3342
+ setOpacity(opacity) {
3343
+ if (this.polygon) {
3344
+ this.polygon.setOpacity(opacity);
3345
+ }
3346
+ },
3347
+ // 显示
3348
+ show() {
3349
+ if (this.polygon) {
3350
+ this.polygon.show();
3351
+ }
3352
+ },
3353
+ // 隐藏
3354
+ hide() {
3355
+ if (this.polygon) {
3356
+ this.polygon.hide();
3357
+ }
3358
+ },
3359
+ // 获取面积
3360
+ getArea() {
3361
+ if (this.polygon) {
3362
+ return this.polygon.getArea();
3363
+ }
3364
+ return 0;
3365
+ },
3366
+ // 获取坐标
3367
+ getCoordinates() {
3368
+ if (this.polygon) {
3369
+ return this.polygon.getCoordinates();
3370
+ }
3371
+ return [];
3372
+ },
3373
+ // 获取中心点
3374
+ getCenter() {
3375
+ if (this.polygon) {
3376
+ return this.polygon.getCenter();
3377
+ }
3378
+ return null;
3379
+ },
3380
+ // 获取范围
3381
+ getExtent() {
3382
+ if (this.polygon) {
3383
+ return this.polygon.getExtent();
3384
+ }
3385
+ return null;
3386
+ },
3387
+ // 获取外轮廓
3388
+ getShell() {
3389
+ if (this.polygon) {
3390
+ return this.polygon.getShell();
3391
+ }
3392
+ return [];
3393
+ },
3394
+ // 获取内孔
3395
+ getHoles() {
3396
+ if (this.polygon) {
3397
+ return this.polygon.getHoles();
3398
+ }
3399
+ return [];
3400
+ },
3401
+ // 获取多边形实例
3402
+ getPolygon() {
3403
+ return this.polygon;
3404
+ },
3405
+ // 获取图层实例
3406
+ getLayer() {
3407
+ return this.layer;
3408
+ }
3409
+ },
3410
+ watch: {
3411
+ coordinates(newVal) {
3412
+ this.setCoordinates(newVal);
3413
+ },
3414
+ symbol: {
3415
+ handler(newVal) {
3416
+ this.setSymbol(newVal);
3417
+ },
3418
+ deep: true
3419
+ },
3420
+ opacity(newVal) {
3421
+ this.setOpacity(newVal);
3422
+ },
3423
+ visible(newVal) {
3424
+ if (newVal) {
3425
+ this.show();
3426
+ } else {
3427
+ this.hide();
3428
+ }
3429
+ }
3430
+ }
3431
+ };
3432
+ var _sfc_render$1 = function render16() {
3433
+ var _vm = this, _c = _vm._self._c;
3434
+ return _c("div", { staticClass: "fy-polygon" });
3435
+ };
3436
+ var _sfc_staticRenderFns$1 = [];
3437
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(
3438
+ _sfc_main$1,
3439
+ _sfc_render$1,
3440
+ _sfc_staticRenderFns$1,
3441
+ false,
3442
+ null,
3443
+ "762f4fba"
3444
+ );
3445
+ const FyPolygonComponent = __component__$1.exports;
3446
+ const FyPolygon = FyPolygonComponent;
3447
+ FyPolygon.install = function(Vue) {
3448
+ Vue.component(FyPolygon.name || "FyPolygon", FyPolygon);
3449
+ };
3450
+ const _sfc_main = {
3451
+ name: "FyCircle",
3452
+ props: {
3453
+ // 圆心坐标 [经度, 纬度]
3454
+ coordinates: {
3455
+ type: Array,
3456
+ required: true
3457
+ },
3458
+ // 半径(米)
3459
+ radius: {
3460
+ type: Number,
3461
+ required: true
3462
+ },
3463
+ // 图层ID
3464
+ layerId: {
3465
+ type: String,
3466
+ default: "circle-layer"
3467
+ },
3468
+ // 圆样式
3469
+ symbol: {
3470
+ type: Object,
3471
+ default: () => ({
3472
+ lineColor: "#ff0000",
3473
+ lineWidth: 2,
3474
+ lineOpacity: 0.8,
3475
+ polygonFill: "#ff0000",
3476
+ polygonOpacity: 0.3
3477
+ })
3478
+ },
3479
+ // 透明度
3480
+ opacity: {
3481
+ type: Number,
3482
+ default: 1
3483
+ },
3484
+ // 可见性
3485
+ visible: {
3486
+ type: Boolean,
3487
+ default: true
3488
+ },
3489
+ // 层级
3490
+ zIndex: {
3491
+ type: Number,
3492
+ default: 10
3493
+ },
3494
+ // 圆弧数量(控制圆的平滑度)
3495
+ numberOfPoints: {
3496
+ type: Number,
3497
+ default: 60
3498
+ },
3499
+ // 自定义属性
3500
+ properties: {
3501
+ type: Object,
3502
+ default: () => ({})
3503
+ }
3504
+ },
3505
+ data() {
3506
+ return {
3507
+ layer: null,
3508
+ circle: null
3509
+ };
3510
+ },
3511
+ inject: {
3512
+ mapInstance: {
3513
+ default: null
3514
+ }
3515
+ },
3516
+ mounted() {
3517
+ if (this.mapInstance) {
3518
+ this.initCircle();
3519
+ }
3520
+ },
3521
+ beforeDestroy() {
3522
+ this.removeCircle();
3523
+ },
3524
+ methods: {
3525
+ // 初始化圆
3526
+ initCircle() {
3527
+ if (!this.mapInstance) return;
3528
+ this.layer = this.mapInstance.getLayer(this.layerId);
3529
+ if (!this.layer) {
3530
+ this.layer = new maptalks.VectorLayer(this.layerId, {
3531
+ zIndex: this.zIndex
3532
+ });
3533
+ this.mapInstance.addLayer(this.layer);
3534
+ }
3535
+ const config = {
3536
+ symbol: this.symbol,
3537
+ visible: this.visible,
3538
+ opacity: this.opacity,
3539
+ properties: this.properties,
3540
+ zIndex: this.zIndex,
3541
+ numberOfPoints: this.numberOfPoints
3542
+ };
3543
+ this.circle = new maptalks.Circle(this.coordinates, this.radius, config);
3544
+ this.circle.on("click", this.handleClick);
3545
+ this.circle.on("mouseover", this.handleMouseover);
3546
+ this.circle.on("mouseout", this.handleMouseout);
3547
+ this.circle.on("dblclick", this.handleDblClick);
3548
+ this.circle.on("mousedown", this.handleMouseDown);
3549
+ this.circle.on("mouseup", this.handleMouseUp);
3550
+ this.layer.addGeometry(this.circle);
3551
+ this.$emit("ready", this.circle);
3552
+ },
3553
+ // 移除圆
3554
+ removeCircle() {
3555
+ if (this.circle && this.layer) {
3556
+ this.circle.off("click", this.handleClick);
3557
+ this.circle.off("mouseover", this.handleMouseover);
3558
+ this.circle.off("mouseout", this.handleMouseout);
3559
+ this.circle.off("dblclick", this.handleDblClick);
3560
+ this.circle.off("mousedown", this.handleMouseDown);
3561
+ this.circle.off("mouseup", this.handleMouseUp);
3562
+ this.layer.removeGeometry(this.circle);
3563
+ this.circle = null;
3564
+ }
3565
+ },
3566
+ // 事件处理
3567
+ handleClick(e) {
3568
+ this.$emit("click", e);
3569
+ },
3570
+ handleMouseover(e) {
3571
+ this.$emit("mouseover", e);
3572
+ },
3573
+ handleMouseout(e) {
3574
+ this.$emit("mouseout", e);
3575
+ },
3576
+ handleDblClick(e) {
3577
+ this.$emit("dblclick", e);
3578
+ },
3579
+ handleMouseDown(e) {
3580
+ this.$emit("mousedown", e);
3581
+ },
3582
+ handleMouseUp(e) {
3583
+ this.$emit("mouseup", e);
3584
+ },
3585
+ // 设置圆心坐标
3586
+ setCoordinates(coordinates) {
3587
+ if (this.circle) {
3588
+ this.circle.setCoordinates(coordinates);
3589
+ }
3590
+ },
3591
+ // 设置半径
3592
+ setRadius(radius) {
3593
+ if (this.circle) {
3594
+ this.circle.setRadius(radius);
3595
+ }
3596
+ },
3597
+ // 设置样式
3598
+ setSymbol(symbol) {
3599
+ if (this.circle) {
3600
+ this.circle.setSymbol(symbol);
3601
+ }
3602
+ },
3603
+ // 设置透明度
3604
+ setOpacity(opacity) {
3605
+ if (this.circle) {
3606
+ this.circle.setOpacity(opacity);
3607
+ }
3608
+ },
3609
+ // 显示
3610
+ show() {
3611
+ if (this.circle) {
3612
+ this.circle.show();
3613
+ }
3614
+ },
3615
+ // 隐藏
3616
+ hide() {
3617
+ if (this.circle) {
3618
+ this.circle.hide();
3619
+ }
3620
+ },
3621
+ // 获取半径
3622
+ getRadius() {
3623
+ if (this.circle) {
3624
+ return this.circle.getRadius();
3625
+ }
3626
+ return 0;
3627
+ },
3628
+ // 获取面积
3629
+ getArea() {
3630
+ if (this.circle) {
3631
+ return this.circle.getArea();
3632
+ }
3633
+ return 0;
3634
+ },
3635
+ // 获取周长
3636
+ getLength() {
3637
+ if (this.circle) {
3638
+ const radius = this.circle.getRadius();
3639
+ return 2 * Math.PI * radius;
3640
+ }
3641
+ return 0;
3642
+ },
3643
+ // 获取坐标
3644
+ getCoordinates() {
3645
+ if (this.circle) {
3646
+ return this.circle.getCoordinates();
3647
+ }
3648
+ return null;
3649
+ },
3650
+ // 获取中心点
3651
+ getCenter() {
3652
+ if (this.circle) {
3653
+ return this.circle.getCenter();
3654
+ }
3655
+ return null;
3656
+ },
3657
+ // 获取范围
3658
+ getExtent() {
3659
+ if (this.circle) {
3660
+ return this.circle.getExtent();
3661
+ }
3662
+ return null;
3663
+ },
3664
+ // 获取边界
3665
+ getBounds() {
3666
+ if (this.circle) {
3667
+ return this.circle.getBounds();
3668
+ }
3669
+ return null;
3670
+ },
3671
+ // 获取圆实例
3672
+ getCircle() {
3673
+ return this.circle;
3674
+ },
3675
+ // 获取图层实例
3676
+ getLayer() {
3677
+ return this.layer;
3678
+ }
3679
+ },
3680
+ watch: {
3681
+ coordinates(newVal) {
3682
+ this.setCoordinates(newVal);
3683
+ },
3684
+ radius(newVal) {
3685
+ this.setRadius(newVal);
3686
+ },
3687
+ symbol: {
3688
+ handler(newVal) {
3689
+ this.setSymbol(newVal);
3690
+ },
3691
+ deep: true
3692
+ },
3693
+ opacity(newVal) {
3694
+ this.setOpacity(newVal);
3695
+ },
3696
+ visible(newVal) {
3697
+ if (newVal) {
3698
+ this.show();
3699
+ } else {
3700
+ this.hide();
3701
+ }
3702
+ }
3703
+ }
3704
+ };
3705
+ var _sfc_render = function render17() {
3706
+ var _vm = this, _c = _vm._self._c;
3707
+ return _c("div", { staticClass: "fy-circle" });
3708
+ };
3709
+ var _sfc_staticRenderFns = [];
3710
+ var __component__ = /* @__PURE__ */ normalizeComponent(
3711
+ _sfc_main,
3712
+ _sfc_render,
3713
+ _sfc_staticRenderFns,
3714
+ false,
3715
+ null,
3716
+ "96938291"
3717
+ );
3718
+ const FyCircleComponent = __component__.exports;
3719
+ const FyCircle = FyCircleComponent;
3720
+ FyCircle.install = function(Vue) {
3721
+ Vue.component(FyCircle.name || "FyCircle", FyCircle);
3722
+ };
3723
+ const components = [
3724
+ MyButton,
3725
+ FyMap,
3726
+ FyTileLayer,
3727
+ FyVectorLayer,
3728
+ FyMarker,
3729
+ FyLabel,
3730
+ FyPopup,
3731
+ FyClusterMarker,
3732
+ FyDrawTool,
3733
+ FyDrawPoint,
3734
+ FyDrawLine,
3735
+ FyDrawPolygon,
3736
+ FyDrawCircle,
3737
+ FyPoint,
3738
+ FyLineString,
3739
+ FyPolygon,
3740
+ FyCircle
3741
+ ];
3742
+ const index = {
3743
+ install(Vue) {
3744
+ components.forEach((comp) => {
3745
+ Vue.component(comp.name || comp.__name, comp);
3746
+ });
3747
+ }
3748
+ };
3749
+ export {
3750
+ FyCircle,
3751
+ FyClusterMarker,
3752
+ FyDrawCircle,
3753
+ FyDrawLine,
3754
+ FyDrawPoint,
3755
+ FyDrawPolygon,
3756
+ FyDrawTool,
3757
+ FyLabel,
3758
+ FyLineString,
3759
+ FyMap,
3760
+ FyMarker,
3761
+ FyPoint,
3762
+ FyPolygon,
3763
+ FyPopup,
3764
+ FyTileLayer,
3765
+ FyVectorLayer,
3766
+ MyButton,
3767
+ index as default
3768
+ };
3769
+ //# sourceMappingURL=fy-map.es.js.map