vue-openlayers-plugin 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{index-03592281.mjs → index-c9143e86.mjs} +3280 -189
- package/lib/{index.es-769bacc2.mjs → index.es-9ab83315.mjs} +1 -1
- package/lib/index.esm.js +15 -9
- package/lib/index.umd.js +3292 -201
- package/lib/style.css +53 -53
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/components/MapContainer.vue.d.ts +15 -4
- package/types/src/components/CustomOpenlayer/components/MapContainer.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/components/PluginContainer/PluginRenderer.vue.d.ts +40 -0
- package/types/src/components/CustomOpenlayer/components/PluginContainer/PluginRenderer.vue.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/components/PluginContainer/index.vue.d.ts +52 -0
- package/types/src/components/CustomOpenlayer/components/PluginContainer/index.vue.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/components/dialogs/BasemapPanel.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerPanel.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/index.vue.d.ts +15 -6
- package/types/src/components/CustomOpenlayer/index.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/types/plugin.d.ts +203 -0
- package/types/src/components/CustomOpenlayer/types/plugin.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/TooltipHelper.d.ts +1 -1
- package/types/src/components/CustomOpenlayer/utils/TooltipHelper.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/drawing/DrawingManager.d.ts +61 -1
- package/types/src/components/CustomOpenlayer/utils/drawing/DrawingManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiLineStringDrawing.d.ts +294 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiLineStringDrawing.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiPointDrawing.d.ts +244 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiPointDrawing.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiPolygonDrawing.d.ts +206 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/MultiPolygonDrawing.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/index.d.ts +27 -4
- package/types/src/components/CustomOpenlayer/utils/drawing/index.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/eventBus.d.ts +16 -1
- package/types/src/components/CustomOpenlayer/utils/eventBus.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layerManager.d.ts +6 -1
- package/types/src/components/CustomOpenlayer/utils/layerManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/mapManager.d.ts +5 -1
- package/types/src/components/CustomOpenlayer/utils/mapManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/measurementTool.d.ts +3 -1
- package/types/src/components/CustomOpenlayer/utils/measurementTool.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/pluginManager.d.ts +158 -0
- package/types/src/components/CustomOpenlayer/utils/pluginManager.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/storage.d.ts +23 -11
- package/types/src/components/CustomOpenlayer/utils/storage.d.ts.map +1 -1
- /package/{readme.md → README.md} +0 -0
|
@@ -19721,6 +19721,27 @@ function mitt(n2) {
|
|
|
19721
19721
|
});
|
|
19722
19722
|
} };
|
|
19723
19723
|
}
|
|
19724
|
+
class LayerEventBus {
|
|
19725
|
+
constructor() {
|
|
19726
|
+
__publicField(this, "emitter");
|
|
19727
|
+
this.emitter = mitt();
|
|
19728
|
+
}
|
|
19729
|
+
emit(type, event) {
|
|
19730
|
+
this.emitter.emit(type, event);
|
|
19731
|
+
}
|
|
19732
|
+
on(type, handler) {
|
|
19733
|
+
this.emitter.on(type, handler);
|
|
19734
|
+
}
|
|
19735
|
+
off(type, handler) {
|
|
19736
|
+
this.emitter.off(type, handler);
|
|
19737
|
+
}
|
|
19738
|
+
clear() {
|
|
19739
|
+
this.emitter.all.clear();
|
|
19740
|
+
}
|
|
19741
|
+
}
|
|
19742
|
+
function createLayerEventBus() {
|
|
19743
|
+
return new LayerEventBus();
|
|
19744
|
+
}
|
|
19724
19745
|
const layerEventBus = mitt();
|
|
19725
19746
|
const tdtImgUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR4nC272c5u2XWe98xm9evr/n63tXcViywWKUqUYtKKpQRKIthIbOQgN5A7y0FyGsRAAAOxpcRwbDWhaFIiKVa3q2o3f/f9X7v6tWaXg81LmO/AmGNgvO8j/ux//uf/bz10LxIprBAwGY+Wkg5HpBVpUKziwB+ewW9qzcZFCCBGkcWaIo8YvSeLC0Iw2MkwGQjCUaYZ7TBx3x0RwSOEIIli5knCMFmOvWFZZKxizawo8Vrz2dvXzGzJj55+n7vjPX3fsSpXjN1IpCVJXhKXO8qlxricb64fqLojOeBEYJQCEwwaRddP7I4dx92AtRNxLLmcp5zPS2yEbsbhW21xHxdFdtm1PUoL4kQTScUkIIkVMiiklsxnMU+SBO1zUiEhePqxZzIOLSPyOMYHzeglaRGB8NjekGUp51ox2RHnLFoLUJI4S8lEAGGpR4eTiqwoiILin/3+P+XPfvJf8x//+j8SgLPTM7759hvKskQhWLcTtRFEWUa5yGl8S+Mcl+UcFwSjcRzrmvW243jsSLTk5HyOVoKzWUYaS3oFaVCR9sYMx8YSaUEsFFJqBm8QwpN4zcV8zvlsjkwmzmzH7ego8xglJRGSXTdijWN/rBmsYZo8WRljg2PoRp6fnrEsSnZNSzATBMuu7kFoEhVRSIEUguOupW8nZmnKV19/ju8MD8cN3dTz+uZbjtWRWPcoGdEJRTzFiGNNO7RkUUw+T5h6x9ubLff1kWGwRB5OZin5XIGSiBDonacdJ6JU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8ZpdqXiWUm8TYx7pRbDLGYcfgc5/CoSHg1GHEMLPQ4uzLOVfeUbZuOvoZrBcZ9emnMUbJuz021jcRY6lldbJa/chJyxA1kIKYmgO9VAz2ffVR4iElpDPk+Q50/5WIYN0ESbKISauPZt5bxxCCUgyWwK+imgBgshOk2eRnpusffAZH8JE48PjuCs2JDmNzQjSemxcdo6dLaikUg322NzeoZTWOnzhOkfcZ7O9iTPhyxT6wX/VRYtCl/w9/mTogQbTdqwAAAABJRU5ErkJggg==";
|
|
@@ -19771,7 +19792,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
19771
19792
|
return lastVisibleBasemap;
|
|
19772
19793
|
}
|
|
19773
19794
|
}
|
|
19774
|
-
return
|
|
19795
|
+
return null;
|
|
19775
19796
|
};
|
|
19776
19797
|
const selectedBasemap = ref(getInitialSelectedBasemap());
|
|
19777
19798
|
const handleClose = () => {
|
|
@@ -19793,6 +19814,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
19793
19814
|
},
|
|
19794
19815
|
{ deep: true, immediate: false }
|
|
19795
19816
|
);
|
|
19817
|
+
watch(
|
|
19818
|
+
() => selectedBasemap.value,
|
|
19819
|
+
(newValue, oldValue) => {
|
|
19820
|
+
console.log("BasemapPanel: selectedBasemap changed from", oldValue, "to", newValue);
|
|
19821
|
+
}
|
|
19822
|
+
);
|
|
19796
19823
|
onMounted(() => {
|
|
19797
19824
|
layerEventBus.on("basemap-changed", handleBasemapChanged);
|
|
19798
19825
|
});
|
|
@@ -19925,14 +19952,26 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
19925
19952
|
return tdtImgUrl;
|
|
19926
19953
|
};
|
|
19927
19954
|
const selectBasemap = (basemap) => {
|
|
19928
|
-
selectedBasemap.value
|
|
19929
|
-
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19955
|
+
const wasSelected = selectedBasemap.value === basemap.id;
|
|
19956
|
+
selectedBasemap.value = wasSelected ? null : basemap.id;
|
|
19957
|
+
if (wasSelected) {
|
|
19958
|
+
layerEventBus.emit("basemap-switch-request", {
|
|
19959
|
+
basemapId: basemap.id,
|
|
19960
|
+
basemapName: basemap.name,
|
|
19961
|
+
basemapType: basemap.type,
|
|
19962
|
+
basemapConfig: null
|
|
19963
|
+
// 传递null表示关闭底图
|
|
19964
|
+
});
|
|
19965
|
+
console.log("BasemapPanel: 请求关闭底图:", basemap.name);
|
|
19966
|
+
} else {
|
|
19967
|
+
layerEventBus.emit("basemap-switch-request", {
|
|
19968
|
+
basemapId: basemap.id,
|
|
19969
|
+
basemapName: basemap.name,
|
|
19970
|
+
basemapType: basemap.type,
|
|
19971
|
+
basemapConfig: basemap
|
|
19972
|
+
});
|
|
19973
|
+
console.log("BasemapPanel: 请求切换底图到:", basemap.name);
|
|
19974
|
+
}
|
|
19936
19975
|
};
|
|
19937
19976
|
return (_ctx, _cache) => {
|
|
19938
19977
|
return openBlock(), createBlock(CustomDialog, {
|
|
@@ -19977,7 +20016,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
19977
20016
|
};
|
|
19978
20017
|
}
|
|
19979
20018
|
});
|
|
19980
|
-
const BasemapPanel = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-
|
|
20019
|
+
const BasemapPanel = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-156831b6"]]);
|
|
19981
20020
|
class Feature extends BaseObject$1 {
|
|
19982
20021
|
/**
|
|
19983
20022
|
* @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]
|
|
@@ -45537,18 +45576,23 @@ const _LayerFactory = class _LayerFactory {
|
|
|
45537
45576
|
__publicField(_LayerFactory, "instance");
|
|
45538
45577
|
let LayerFactory = _LayerFactory;
|
|
45539
45578
|
const layerFactory = LayerFactory.getInstance();
|
|
45540
|
-
const STORAGE_KEYS = {
|
|
45541
|
-
MEASUREMENTS: "openlayer_measurements",
|
|
45542
|
-
LAYER_CONFIGS: "openlayer_layer_configs",
|
|
45543
|
-
MAP_STATE: "openlayer_map_state"
|
|
45544
|
-
};
|
|
45545
45579
|
class MapStorage {
|
|
45580
|
+
constructor(instanceId) {
|
|
45581
|
+
__publicField(this, "storageKeys");
|
|
45582
|
+
__publicField(this, "instanceId");
|
|
45583
|
+
this.instanceId = instanceId || "default";
|
|
45584
|
+
this.storageKeys = {
|
|
45585
|
+
MEASUREMENTS: `${this.instanceId}_openlayer_measurements`,
|
|
45586
|
+
LAYER_CONFIGS: `${this.instanceId}_openlayer_layer_configs`,
|
|
45587
|
+
MAP_STATE: `${this.instanceId}_openlayer_map_state`
|
|
45588
|
+
};
|
|
45589
|
+
}
|
|
45546
45590
|
/**
|
|
45547
45591
|
* 保存测量结果
|
|
45548
45592
|
*/
|
|
45549
|
-
|
|
45593
|
+
saveMeasurements(measurements) {
|
|
45550
45594
|
try {
|
|
45551
|
-
localStorage.setItem(
|
|
45595
|
+
localStorage.setItem(this.storageKeys.MEASUREMENTS, JSON.stringify(measurements));
|
|
45552
45596
|
} catch (error) {
|
|
45553
45597
|
console.error("保存测量结果失败:", error);
|
|
45554
45598
|
}
|
|
@@ -45556,9 +45600,9 @@ class MapStorage {
|
|
|
45556
45600
|
/**
|
|
45557
45601
|
* 获取测量结果
|
|
45558
45602
|
*/
|
|
45559
|
-
|
|
45603
|
+
getMeasurements() {
|
|
45560
45604
|
try {
|
|
45561
|
-
const data = localStorage.getItem(
|
|
45605
|
+
const data = localStorage.getItem(this.storageKeys.MEASUREMENTS);
|
|
45562
45606
|
return data ? JSON.parse(data) : [];
|
|
45563
45607
|
} catch (error) {
|
|
45564
45608
|
console.error("获取测量结果失败:", error);
|
|
@@ -45568,7 +45612,7 @@ class MapStorage {
|
|
|
45568
45612
|
/**
|
|
45569
45613
|
* 添加单个测量结果
|
|
45570
45614
|
*/
|
|
45571
|
-
|
|
45615
|
+
addMeasurement(measurement) {
|
|
45572
45616
|
const measurements = this.getMeasurements();
|
|
45573
45617
|
measurements.push(measurement);
|
|
45574
45618
|
this.saveMeasurements(measurements);
|
|
@@ -45576,20 +45620,20 @@ class MapStorage {
|
|
|
45576
45620
|
/**
|
|
45577
45621
|
* 删除测量结果
|
|
45578
45622
|
*/
|
|
45579
|
-
|
|
45623
|
+
removeMeasurement(id) {
|
|
45580
45624
|
const measurements = this.getMeasurements().filter((m2) => m2.id !== id);
|
|
45581
45625
|
this.saveMeasurements(measurements);
|
|
45582
45626
|
}
|
|
45583
45627
|
/**
|
|
45584
45628
|
* 清空所有测量结果
|
|
45585
45629
|
*/
|
|
45586
|
-
|
|
45587
|
-
localStorage.removeItem(
|
|
45630
|
+
clearMeasurements() {
|
|
45631
|
+
localStorage.removeItem(this.storageKeys.MEASUREMENTS);
|
|
45588
45632
|
}
|
|
45589
45633
|
/**
|
|
45590
45634
|
* 保存图层配置
|
|
45591
45635
|
*/
|
|
45592
|
-
|
|
45636
|
+
saveLayerConfigs(configs) {
|
|
45593
45637
|
try {
|
|
45594
45638
|
const configsToSave = configs.map((config) => ({
|
|
45595
45639
|
id: config.id,
|
|
@@ -45602,7 +45646,7 @@ class MapStorage {
|
|
|
45602
45646
|
legend: config.legend,
|
|
45603
45647
|
metadata: config.metadata
|
|
45604
45648
|
}));
|
|
45605
|
-
localStorage.setItem(
|
|
45649
|
+
localStorage.setItem(this.storageKeys.LAYER_CONFIGS, JSON.stringify(configsToSave));
|
|
45606
45650
|
} catch (error) {
|
|
45607
45651
|
console.error("保存图层配置失败:", error);
|
|
45608
45652
|
}
|
|
@@ -45610,9 +45654,9 @@ class MapStorage {
|
|
|
45610
45654
|
/**
|
|
45611
45655
|
* 获取图层配置
|
|
45612
45656
|
*/
|
|
45613
|
-
|
|
45657
|
+
getLayerConfigs() {
|
|
45614
45658
|
try {
|
|
45615
|
-
const data = localStorage.getItem(
|
|
45659
|
+
const data = localStorage.getItem(this.storageKeys.LAYER_CONFIGS);
|
|
45616
45660
|
return data ? JSON.parse(data) : [];
|
|
45617
45661
|
} catch (error) {
|
|
45618
45662
|
console.error("获取图层配置失败:", error);
|
|
@@ -45622,10 +45666,10 @@ class MapStorage {
|
|
|
45622
45666
|
/**
|
|
45623
45667
|
* 保存地图状态
|
|
45624
45668
|
*/
|
|
45625
|
-
|
|
45669
|
+
saveMapState(center, zoom, rotation = 0) {
|
|
45626
45670
|
try {
|
|
45627
45671
|
const state = { center, zoom, rotation, timestamp: Date.now() };
|
|
45628
|
-
localStorage.setItem(
|
|
45672
|
+
localStorage.setItem(this.storageKeys.MAP_STATE, JSON.stringify(state));
|
|
45629
45673
|
} catch (error) {
|
|
45630
45674
|
console.error("保存地图状态失败:", error);
|
|
45631
45675
|
}
|
|
@@ -45633,9 +45677,9 @@ class MapStorage {
|
|
|
45633
45677
|
/**
|
|
45634
45678
|
* 获取地图状态
|
|
45635
45679
|
*/
|
|
45636
|
-
|
|
45680
|
+
getMapState() {
|
|
45637
45681
|
try {
|
|
45638
|
-
const data = localStorage.getItem(
|
|
45682
|
+
const data = localStorage.getItem(this.storageKeys.MAP_STATE);
|
|
45639
45683
|
return data ? JSON.parse(data) : null;
|
|
45640
45684
|
} catch (error) {
|
|
45641
45685
|
console.error("获取地图状态失败:", error);
|
|
@@ -45645,31 +45689,38 @@ class MapStorage {
|
|
|
45645
45689
|
/**
|
|
45646
45690
|
* 清空所有缓存
|
|
45647
45691
|
*/
|
|
45648
|
-
|
|
45649
|
-
Object.values(
|
|
45692
|
+
clearAll() {
|
|
45693
|
+
Object.values(this.storageKeys).forEach((key) => {
|
|
45650
45694
|
localStorage.removeItem(key);
|
|
45651
45695
|
});
|
|
45652
45696
|
}
|
|
45653
45697
|
/**
|
|
45654
45698
|
* 获取存储大小(KB)
|
|
45655
45699
|
*/
|
|
45656
|
-
|
|
45700
|
+
getStorageSize() {
|
|
45657
45701
|
let total = 0;
|
|
45658
|
-
Object.values(
|
|
45659
|
-
const
|
|
45660
|
-
if (
|
|
45661
|
-
total +=
|
|
45702
|
+
Object.values(this.storageKeys).forEach((key) => {
|
|
45703
|
+
const item = localStorage.getItem(key);
|
|
45704
|
+
if (item) {
|
|
45705
|
+
total += item.length;
|
|
45662
45706
|
}
|
|
45663
45707
|
});
|
|
45664
45708
|
return Math.round(total / 1024 * 100) / 100;
|
|
45665
45709
|
}
|
|
45666
45710
|
}
|
|
45711
|
+
function createMapStorage(instanceId) {
|
|
45712
|
+
return new MapStorage(instanceId);
|
|
45713
|
+
}
|
|
45667
45714
|
class LayerManager {
|
|
45668
|
-
constructor(map) {
|
|
45715
|
+
constructor(map, eventBus, storage) {
|
|
45669
45716
|
__publicField(this, "map");
|
|
45670
45717
|
__publicField(this, "layerHandlers", /* @__PURE__ */ new Map());
|
|
45671
45718
|
__publicField(this, "layerConfigs", /* @__PURE__ */ new Map());
|
|
45719
|
+
__publicField(this, "eventBus");
|
|
45720
|
+
__publicField(this, "storage");
|
|
45672
45721
|
this.map = map;
|
|
45722
|
+
this.eventBus = eventBus;
|
|
45723
|
+
this.storage = storage;
|
|
45673
45724
|
this.loadLayerConfigs();
|
|
45674
45725
|
}
|
|
45675
45726
|
/**
|
|
@@ -45681,7 +45732,8 @@ class LayerManager {
|
|
|
45681
45732
|
const fullConfig = {
|
|
45682
45733
|
...config,
|
|
45683
45734
|
id: layerId,
|
|
45684
|
-
visible: config.visible ??
|
|
45735
|
+
visible: config.visible ?? false,
|
|
45736
|
+
// 默认设置为false,避免意外激活图层
|
|
45685
45737
|
opacity: config.opacity ?? 1,
|
|
45686
45738
|
zIndex: config.zIndex ?? 0
|
|
45687
45739
|
};
|
|
@@ -45696,7 +45748,7 @@ class LayerManager {
|
|
|
45696
45748
|
this.layerConfigs.set(fullConfig.id, fullConfig);
|
|
45697
45749
|
this.map.addLayer(layer);
|
|
45698
45750
|
this.saveLayerConfigs();
|
|
45699
|
-
|
|
45751
|
+
this.eventBus.emit("layer-added", {
|
|
45700
45752
|
layerId: fullConfig.id,
|
|
45701
45753
|
layerName: fullConfig.name,
|
|
45702
45754
|
layerType: fullConfig.type,
|
|
@@ -45721,7 +45773,8 @@ class LayerManager {
|
|
|
45721
45773
|
const childFullConfig = {
|
|
45722
45774
|
...childConfig,
|
|
45723
45775
|
id: childLayerId,
|
|
45724
|
-
visible: childConfig.visible ?? groupConfig.visible,
|
|
45776
|
+
visible: childConfig.visible ?? (groupConfig.visible ?? false),
|
|
45777
|
+
// 确保默认为false
|
|
45725
45778
|
opacity: childConfig.opacity ?? groupConfig.opacity
|
|
45726
45779
|
};
|
|
45727
45780
|
if (this.addLayer(childFullConfig)) {
|
|
@@ -45732,7 +45785,7 @@ class LayerManager {
|
|
|
45732
45785
|
groupConfig.children = childLayers;
|
|
45733
45786
|
this.layerConfigs.set(groupConfig.id, groupConfig);
|
|
45734
45787
|
this.saveLayerConfigs();
|
|
45735
|
-
|
|
45788
|
+
this.eventBus.emit("layer-added", {
|
|
45736
45789
|
layerId: groupConfig.id,
|
|
45737
45790
|
layerName: groupConfig.name,
|
|
45738
45791
|
layerType: groupConfig.type,
|
|
@@ -45763,7 +45816,7 @@ class LayerManager {
|
|
|
45763
45816
|
this.layerHandlers.delete(layerId);
|
|
45764
45817
|
this.layerConfigs.delete(layerId);
|
|
45765
45818
|
this.saveLayerConfigs();
|
|
45766
|
-
|
|
45819
|
+
this.eventBus.emit("layer-removed", {
|
|
45767
45820
|
layerId,
|
|
45768
45821
|
layerName: config.name,
|
|
45769
45822
|
layerType: config.type
|
|
@@ -45896,7 +45949,7 @@ class LayerManager {
|
|
|
45896
45949
|
handler.setVisible(visible);
|
|
45897
45950
|
config.visible = visible;
|
|
45898
45951
|
this.saveLayerConfigs();
|
|
45899
|
-
|
|
45952
|
+
this.eventBus.emit("layer-visibility-changed", {
|
|
45900
45953
|
layerId,
|
|
45901
45954
|
visible,
|
|
45902
45955
|
layerName: config.name,
|
|
@@ -45921,7 +45974,7 @@ class LayerManager {
|
|
|
45921
45974
|
handler.setOpacity(opacity2);
|
|
45922
45975
|
config.opacity = opacity2;
|
|
45923
45976
|
this.saveLayerConfigs();
|
|
45924
|
-
|
|
45977
|
+
this.eventBus.emit("layer-opacity-changed", {
|
|
45925
45978
|
layerId,
|
|
45926
45979
|
opacity: config.opacity
|
|
45927
45980
|
});
|
|
@@ -45945,7 +45998,7 @@ class LayerManager {
|
|
|
45945
45998
|
this.layerConfigs.set(layerId, updatedConfig);
|
|
45946
45999
|
handler.updateConfig(newConfig);
|
|
45947
46000
|
this.saveLayerConfigs();
|
|
45948
|
-
|
|
46001
|
+
this.eventBus.emit("layer-config-updated", {
|
|
45949
46002
|
layerId,
|
|
45950
46003
|
config: updatedConfig
|
|
45951
46004
|
});
|
|
@@ -46002,7 +46055,7 @@ class LayerManager {
|
|
|
46002
46055
|
*/
|
|
46003
46056
|
loadLayerConfigs() {
|
|
46004
46057
|
try {
|
|
46005
|
-
const configs =
|
|
46058
|
+
const configs = this.storage.getLayerConfigs();
|
|
46006
46059
|
configs.forEach((config) => {
|
|
46007
46060
|
if (!config.id)
|
|
46008
46061
|
return;
|
|
@@ -46028,7 +46081,7 @@ class LayerManager {
|
|
|
46028
46081
|
saveLayerConfigs() {
|
|
46029
46082
|
try {
|
|
46030
46083
|
const configs = Array.from(this.layerConfigs.values());
|
|
46031
|
-
|
|
46084
|
+
this.storage.saveLayerConfigs(configs);
|
|
46032
46085
|
} catch (error) {
|
|
46033
46086
|
console.error("保存图层配置失败:", error);
|
|
46034
46087
|
}
|
|
@@ -46343,15 +46396,17 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46343
46396
|
const view = map.value.getView();
|
|
46344
46397
|
if (!extent || extent.every((coord) => !isFinite(coord))) {
|
|
46345
46398
|
if (data.layerData.center && Array.isArray(data.layerData.center) && data.layerData.center.length === 2) {
|
|
46399
|
+
const mapProjection = view.getProjection().getCode();
|
|
46400
|
+
const center = mapProjection === "EPSG:4326" ? data.layerData.center : fromLonLat(data.layerData.center);
|
|
46346
46401
|
if (finalAnimationConfig.enabled) {
|
|
46347
46402
|
view.animate({
|
|
46348
|
-
center
|
|
46403
|
+
center,
|
|
46349
46404
|
zoom: 12,
|
|
46350
46405
|
duration: finalAnimationConfig.duration,
|
|
46351
46406
|
easing: getEasingFunction(finalAnimationConfig.easing)
|
|
46352
46407
|
});
|
|
46353
46408
|
} else {
|
|
46354
|
-
view.setCenter(
|
|
46409
|
+
view.setCenter(center);
|
|
46355
46410
|
view.setZoom(12);
|
|
46356
46411
|
}
|
|
46357
46412
|
ElMessage.success(`已定位到图层中心点: ${data.layerData.name}`);
|
|
@@ -46394,28 +46449,42 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46394
46449
|
const onTreeCheck = (data, { checkedKeys, checkedNodes }) => {
|
|
46395
46450
|
const allNodes = getAllTreeNodes(treeData.value);
|
|
46396
46451
|
const group = layerGroups.value.find((g2) => g2.layers.some((l2) => l2.id === data.id));
|
|
46397
|
-
if ((group == null ? void 0 : group.id) === "baseLayers"
|
|
46398
|
-
|
|
46399
|
-
|
|
46400
|
-
|
|
46401
|
-
layer.
|
|
46402
|
-
|
|
46403
|
-
|
|
46404
|
-
|
|
46405
|
-
|
|
46406
|
-
|
|
46452
|
+
if ((group == null ? void 0 : group.id) === "baseLayers") {
|
|
46453
|
+
if (checkedKeys.includes(data.id)) {
|
|
46454
|
+
let selectedLayer2 = null;
|
|
46455
|
+
group.layers.forEach((layer) => {
|
|
46456
|
+
if (layer.id === data.id) {
|
|
46457
|
+
layer.visible = true;
|
|
46458
|
+
handleLayerVisibilityChange(layer);
|
|
46459
|
+
selectedLayer2 = layer;
|
|
46460
|
+
} else {
|
|
46461
|
+
layer.visible = false;
|
|
46462
|
+
handleLayerVisibilityChange(layer);
|
|
46463
|
+
}
|
|
46464
|
+
});
|
|
46465
|
+
if (selectedLayer2) {
|
|
46466
|
+
layerEventBus.emit("basemap-changed", {
|
|
46467
|
+
basemapId: selectedLayer2.id,
|
|
46468
|
+
basemapName: selectedLayer2.name,
|
|
46469
|
+
basemapType: selectedLayer2.type
|
|
46470
|
+
});
|
|
46407
46471
|
}
|
|
46408
|
-
|
|
46409
|
-
|
|
46410
|
-
|
|
46411
|
-
|
|
46412
|
-
|
|
46413
|
-
|
|
46472
|
+
nextTick(() => {
|
|
46473
|
+
treeRef.value.setCheckedKeys([data.id]);
|
|
46474
|
+
});
|
|
46475
|
+
} else {
|
|
46476
|
+
const targetLayer = group.layers.find((layer) => layer.id === data.id);
|
|
46477
|
+
if (targetLayer) {
|
|
46478
|
+
console.log("LayerPanel onTreeCheck - 取消勾选底图:", targetLayer.name, "当前visible:", targetLayer.visible);
|
|
46479
|
+
targetLayer.visible = false;
|
|
46480
|
+
console.log("LayerPanel onTreeCheck - 设置visible=false后:", targetLayer.visible);
|
|
46481
|
+
handleLayerVisibilityChange(targetLayer);
|
|
46482
|
+
console.log("LayerPanel onTreeCheck - 调用handleLayerVisibilityChange完成");
|
|
46483
|
+
}
|
|
46484
|
+
nextTick(() => {
|
|
46485
|
+
syncTreeCheckedState();
|
|
46414
46486
|
});
|
|
46415
46487
|
}
|
|
46416
|
-
nextTick(() => {
|
|
46417
|
-
treeRef.value.setCheckedKeys([data.id]);
|
|
46418
|
-
});
|
|
46419
46488
|
return;
|
|
46420
46489
|
}
|
|
46421
46490
|
allNodes.forEach((node) => {
|
|
@@ -46465,6 +46534,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46465
46534
|
const props = __props;
|
|
46466
46535
|
const config = inject("layerPanelConfig");
|
|
46467
46536
|
const map = inject("map");
|
|
46537
|
+
const eventBus = inject("eventBus");
|
|
46538
|
+
const storage = inject("storage");
|
|
46468
46539
|
const layers = ref([]);
|
|
46469
46540
|
ref(null);
|
|
46470
46541
|
const emit = __emit;
|
|
@@ -46555,8 +46626,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46555
46626
|
}
|
|
46556
46627
|
};
|
|
46557
46628
|
const initializeLayerManager = () => {
|
|
46558
|
-
if (map && map.value && !layerManager.value) {
|
|
46559
|
-
layerManager.value = new LayerManager(map.value);
|
|
46629
|
+
if (map && map.value && !layerManager.value && eventBus && storage) {
|
|
46630
|
+
layerManager.value = new LayerManager(map.value, eventBus, storage);
|
|
46560
46631
|
initializeLayers();
|
|
46561
46632
|
}
|
|
46562
46633
|
};
|
|
@@ -46675,11 +46746,16 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46675
46746
|
handleLayerChange(layer);
|
|
46676
46747
|
};
|
|
46677
46748
|
const handleLayerVisibilityChange = (layer) => {
|
|
46749
|
+
console.log("LayerPanel handleLayerVisibilityChange:", layer.name, "visible:", layer.visible);
|
|
46678
46750
|
if (layerManager.value) {
|
|
46751
|
+
console.log("LayerPanel handleLayerVisibilityChange - 调用layerManager.setLayerVisible");
|
|
46679
46752
|
layerManager.value.setLayerVisible(layer.id, layer.visible);
|
|
46753
|
+
console.log("LayerPanel handleLayerVisibilityChange - 调用updateLayerConfig");
|
|
46680
46754
|
updateLayerConfig(layer.id, {
|
|
46681
46755
|
visible: layer.visible
|
|
46682
46756
|
});
|
|
46757
|
+
} else {
|
|
46758
|
+
console.warn("LayerPanel handleLayerVisibilityChange - layerManager不存在");
|
|
46683
46759
|
}
|
|
46684
46760
|
layerEventBus.emit("layer-visibility-change", {
|
|
46685
46761
|
layerId: layer.id,
|
|
@@ -46707,9 +46783,20 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46707
46783
|
emit("layer-change", layer);
|
|
46708
46784
|
};
|
|
46709
46785
|
const updateLayerConfig = (layerId, updates) => {
|
|
46786
|
+
console.log("LayerPanel updateLayerConfig:", layerId, updates);
|
|
46710
46787
|
const layer = layers.value.find((l2) => l2.id === layerId);
|
|
46711
46788
|
if (layer) {
|
|
46789
|
+
console.log("LayerPanel updateLayerConfig - 找到图层:", layer.name, "当前visible:", layer.visible);
|
|
46712
46790
|
Object.assign(layer, updates);
|
|
46791
|
+
console.log("LayerPanel updateLayerConfig - 更新后visible:", layer.visible);
|
|
46792
|
+
if (layerManager.value) {
|
|
46793
|
+
console.log("LayerPanel updateLayerConfig - 调用layerManager.updateLayerConfig");
|
|
46794
|
+
layerManager.value.updateLayerConfig(layerId, updates);
|
|
46795
|
+
} else {
|
|
46796
|
+
console.warn("LayerPanel updateLayerConfig - layerManager不存在");
|
|
46797
|
+
}
|
|
46798
|
+
} else {
|
|
46799
|
+
console.warn("LayerPanel updateLayerConfig - 未找到图层:", layerId);
|
|
46713
46800
|
}
|
|
46714
46801
|
};
|
|
46715
46802
|
const getLayerIcon = (layerType) => {
|
|
@@ -46748,8 +46835,25 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46748
46835
|
console.warn("LayerPanel: 未找到底图分组");
|
|
46749
46836
|
return;
|
|
46750
46837
|
}
|
|
46838
|
+
if (event.basemapConfig === null) {
|
|
46839
|
+
console.log("LayerPanel: 请求关闭底图:", event.basemapName);
|
|
46840
|
+
const targetLayer2 = baseLayersGroup.layers.find((layer) => layer.id === event.basemapId);
|
|
46841
|
+
if (targetLayer2 && targetLayer2.visible) {
|
|
46842
|
+
targetLayer2.visible = false;
|
|
46843
|
+
handleLayerVisibilityChange(targetLayer2);
|
|
46844
|
+
nextTick(() => {
|
|
46845
|
+
if (treeRef.value) {
|
|
46846
|
+
const currentCheckedKeys = treeRef.value.getCheckedKeys();
|
|
46847
|
+
const newCheckedKeys = currentCheckedKeys.filter((key) => key !== event.basemapId);
|
|
46848
|
+
treeRef.value.setCheckedKeys(newCheckedKeys);
|
|
46849
|
+
}
|
|
46850
|
+
});
|
|
46851
|
+
console.log("LayerPanel: 底图已关闭:", event.basemapName);
|
|
46852
|
+
}
|
|
46853
|
+
return;
|
|
46854
|
+
}
|
|
46751
46855
|
let targetLayer = baseLayersGroup.layers.find((layer) => layer.id === event.basemapId);
|
|
46752
|
-
if (!targetLayer && layerManager.value) {
|
|
46856
|
+
if (!targetLayer && layerManager.value && event.basemapConfig) {
|
|
46753
46857
|
console.log("LayerPanel: 底图不存在,尝试添加:", event.basemapConfig);
|
|
46754
46858
|
const success = layerManager.value.addLayer(event.basemapConfig);
|
|
46755
46859
|
if (success) {
|
|
@@ -46884,7 +46988,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
46884
46988
|
};
|
|
46885
46989
|
}
|
|
46886
46990
|
});
|
|
46887
|
-
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
46991
|
+
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-ab4e807a"]]);
|
|
46888
46992
|
const icons = {
|
|
46889
46993
|
pointMarker: new URL("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPg0KICA8cGF0aCBkPSJNMjEgMTBjMCA3LTkgMTMtOSAxM3MtOS02LTktMTNhOSA5IDAgMCAxIDE4IDB6Ii8+DQogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTAiIHI9IjMiLz4NCjwvc3ZnPg==", self.location).href,
|
|
46890
46994
|
textMarker: new URL("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPg0KICA8cG9seWxpbmUgcG9pbnRzPSI0IDcgNCA0IDIwIDQgMjAgNyIvPg0KICA8bGluZSB4MT0iOSIgeTE9IjIwIiB4Mj0iMTUiIHkyPSIyMCIvPg0KICA8bGluZSB4MT0iMTIiIHkxPSI0IiB4Mj0iMTIiIHkyPSIyMCIvPg0KPC9zdmc+", self.location).href,
|
|
@@ -50959,12 +51063,15 @@ const DrawingTooltipTexts = {
|
|
|
50959
51063
|
circle: "按住鼠标左键并拖拽绘制圆形",
|
|
50960
51064
|
star: "按住鼠标左键并拖拽绘制星形",
|
|
50961
51065
|
text: "点击地图添加文字标注",
|
|
51066
|
+
multipoint: "点击地图添加多个点位,双击结束绘制",
|
|
51067
|
+
multilinestring: "点击开始绘制多线段,双击结束当前线段,Shift+双击完成所有绘制",
|
|
51068
|
+
multipolygon: "点击开始绘制多边形,双击结束当前多边形,Shift+双击完成所有绘制",
|
|
50962
51069
|
select: "",
|
|
50963
51070
|
modify: "",
|
|
50964
51071
|
none: ""
|
|
50965
51072
|
};
|
|
50966
51073
|
class MeasurementTool {
|
|
50967
|
-
constructor(map, options = {}) {
|
|
51074
|
+
constructor(map, storage, options = {}) {
|
|
50968
51075
|
__publicField(this, "map");
|
|
50969
51076
|
__publicField(this, "source");
|
|
50970
51077
|
__publicField(this, "layer");
|
|
@@ -50986,9 +51093,11 @@ class MeasurementTool {
|
|
|
50986
51093
|
__publicField(this, "areaTooltips", []);
|
|
50987
51094
|
__publicField(this, "angleTooltips", []);
|
|
50988
51095
|
__publicField(this, "measurements", []);
|
|
51096
|
+
__publicField(this, "storage");
|
|
50989
51097
|
// 属性
|
|
50990
51098
|
__publicField(this, "nodeMarkers", []);
|
|
50991
51099
|
this.map = map;
|
|
51100
|
+
this.storage = storage;
|
|
50992
51101
|
this.options = {
|
|
50993
51102
|
// 线条样式默认值
|
|
50994
51103
|
strokeColor: "#ffcc33",
|
|
@@ -51322,7 +51431,7 @@ class MeasurementTool {
|
|
|
51322
51431
|
// 保存测量数据到localStorage
|
|
51323
51432
|
saveMeasurements() {
|
|
51324
51433
|
try {
|
|
51325
|
-
|
|
51434
|
+
this.storage.saveMeasurements(this.measurements);
|
|
51326
51435
|
} catch (error) {
|
|
51327
51436
|
console.warn("Failed to save measurements:", error);
|
|
51328
51437
|
}
|
|
@@ -51390,12 +51499,12 @@ class MeasurementTool {
|
|
|
51390
51499
|
});
|
|
51391
51500
|
});
|
|
51392
51501
|
}
|
|
51393
|
-
//
|
|
51502
|
+
// 从存储加载测量数据
|
|
51394
51503
|
loadMeasurements() {
|
|
51395
51504
|
try {
|
|
51396
|
-
const saved =
|
|
51505
|
+
const saved = this.storage.getMeasurements();
|
|
51397
51506
|
if (saved) {
|
|
51398
|
-
this.measurements =
|
|
51507
|
+
this.measurements = saved;
|
|
51399
51508
|
}
|
|
51400
51509
|
} catch (error) {
|
|
51401
51510
|
console.warn("Failed to load measurements:", error);
|
|
@@ -56588,64 +56697,2504 @@ class PolygonDrawing extends BaseDrawing {
|
|
|
56588
56697
|
return color2;
|
|
56589
56698
|
}
|
|
56590
56699
|
}
|
|
56591
|
-
class PolygonDrawingFactory {
|
|
56700
|
+
class PolygonDrawingFactory {
|
|
56701
|
+
static create(config) {
|
|
56702
|
+
return new PolygonDrawing(config);
|
|
56703
|
+
}
|
|
56704
|
+
static getType() {
|
|
56705
|
+
return "polygon";
|
|
56706
|
+
}
|
|
56707
|
+
static getSupportedTypes() {
|
|
56708
|
+
return ["polygon", "circle", "rectangle", "area"];
|
|
56709
|
+
}
|
|
56710
|
+
/**
|
|
56711
|
+
* 创建预设样式的面
|
|
56712
|
+
*/
|
|
56713
|
+
static createPreset(coordinates2, type, preset, options) {
|
|
56714
|
+
const presetStyles = {
|
|
56715
|
+
default: {
|
|
56716
|
+
fillColor: "#409eff",
|
|
56717
|
+
strokeColor: "#409eff",
|
|
56718
|
+
fillOpacity: 0.3,
|
|
56719
|
+
strokeOpacity: 1
|
|
56720
|
+
},
|
|
56721
|
+
highlight: {
|
|
56722
|
+
fillColor: "#ffeb3b",
|
|
56723
|
+
strokeColor: "#ff9800",
|
|
56724
|
+
fillOpacity: 0.4,
|
|
56725
|
+
strokeOpacity: 1
|
|
56726
|
+
},
|
|
56727
|
+
warning: {
|
|
56728
|
+
fillColor: "#e6a23c",
|
|
56729
|
+
strokeColor: "#e6a23c",
|
|
56730
|
+
fillOpacity: 0.3,
|
|
56731
|
+
strokeOpacity: 1
|
|
56732
|
+
},
|
|
56733
|
+
success: {
|
|
56734
|
+
fillColor: "#67c23a",
|
|
56735
|
+
strokeColor: "#67c23a",
|
|
56736
|
+
fillOpacity: 0.3,
|
|
56737
|
+
strokeOpacity: 1
|
|
56738
|
+
},
|
|
56739
|
+
danger: {
|
|
56740
|
+
fillColor: "#f56c6c",
|
|
56741
|
+
strokeColor: "#f56c6c",
|
|
56742
|
+
fillOpacity: 0.3,
|
|
56743
|
+
strokeOpacity: 1
|
|
56744
|
+
}
|
|
56745
|
+
};
|
|
56746
|
+
const config = {
|
|
56747
|
+
type,
|
|
56748
|
+
name: options == null ? void 0 : options.name,
|
|
56749
|
+
coordinates: coordinates2,
|
|
56750
|
+
style: {
|
|
56751
|
+
...presetStyles[preset],
|
|
56752
|
+
textContent: options == null ? void 0 : options.text,
|
|
56753
|
+
showArea: (options == null ? void 0 : options.showArea) || false,
|
|
56754
|
+
showPerimeter: (options == null ? void 0 : options.showPerimeter) || false
|
|
56755
|
+
}
|
|
56756
|
+
};
|
|
56757
|
+
return new PolygonDrawing(config);
|
|
56758
|
+
}
|
|
56759
|
+
}
|
|
56760
|
+
class MultiPolygonDrawing extends BaseDrawing {
|
|
56761
|
+
constructor(config) {
|
|
56762
|
+
super(config);
|
|
56763
|
+
__publicField(this, "_config");
|
|
56764
|
+
__publicField(this, "_style");
|
|
56765
|
+
this._config = config;
|
|
56766
|
+
this._style = {
|
|
56767
|
+
fillColor: "#409eff",
|
|
56768
|
+
strokeColor: "#409eff",
|
|
56769
|
+
strokeWidth: 2,
|
|
56770
|
+
strokeOpacity: 1,
|
|
56771
|
+
fillOpacity: 0.3,
|
|
56772
|
+
showVertices: false,
|
|
56773
|
+
vertexSize: 6,
|
|
56774
|
+
vertexColor: "#409eff",
|
|
56775
|
+
showArea: false,
|
|
56776
|
+
areaUnit: "m²",
|
|
56777
|
+
areaPrecision: 2,
|
|
56778
|
+
showPerimeter: false,
|
|
56779
|
+
perimeterUnit: "m",
|
|
56780
|
+
perimeterPrecision: 2,
|
|
56781
|
+
showPolygonIndex: false,
|
|
56782
|
+
indexFontSize: 12,
|
|
56783
|
+
indexColor: "#333333",
|
|
56784
|
+
...config.style
|
|
56785
|
+
};
|
|
56786
|
+
}
|
|
56787
|
+
/**
|
|
56788
|
+
* 创建要素
|
|
56789
|
+
*/
|
|
56790
|
+
createFeature() {
|
|
56791
|
+
const geometry = this.createMultiPolygonGeometry();
|
|
56792
|
+
this.feature = new Feature$2({
|
|
56793
|
+
geometry,
|
|
56794
|
+
id: this.getId(),
|
|
56795
|
+
type: this.getType(),
|
|
56796
|
+
name: this.getName(),
|
|
56797
|
+
properties: this.getProperties()
|
|
56798
|
+
});
|
|
56799
|
+
}
|
|
56800
|
+
/**
|
|
56801
|
+
* 创建多多边形几何
|
|
56802
|
+
*/
|
|
56803
|
+
createMultiPolygonGeometry() {
|
|
56804
|
+
const coordinates2 = this._config.coordinates;
|
|
56805
|
+
if (!coordinates2 || coordinates2.length === 0) {
|
|
56806
|
+
throw new Error("MultiPolygon coordinates cannot be empty");
|
|
56807
|
+
}
|
|
56808
|
+
const closedCoordinates = coordinates2.map((polygonCoords) => {
|
|
56809
|
+
return polygonCoords.map((ring) => {
|
|
56810
|
+
const closedRing = [...ring];
|
|
56811
|
+
const first = ring[0];
|
|
56812
|
+
const last = ring[ring.length - 1];
|
|
56813
|
+
if (first[0] !== last[0] || first[1] !== last[1]) {
|
|
56814
|
+
closedRing.push([first[0], first[1]]);
|
|
56815
|
+
}
|
|
56816
|
+
return closedRing;
|
|
56817
|
+
});
|
|
56818
|
+
});
|
|
56819
|
+
return new MultiPolygon$1(closedCoordinates);
|
|
56820
|
+
}
|
|
56821
|
+
/**
|
|
56822
|
+
* 创建样式
|
|
56823
|
+
*/
|
|
56824
|
+
createStyle() {
|
|
56825
|
+
const styles = [];
|
|
56826
|
+
styles.push(this.createMultiPolygonStyle());
|
|
56827
|
+
if (this._style.showVertices) {
|
|
56828
|
+
styles.push(...this.createVertexStyles());
|
|
56829
|
+
}
|
|
56830
|
+
if (this._style.showArea) {
|
|
56831
|
+
styles.push(...this.createAreaStyles());
|
|
56832
|
+
}
|
|
56833
|
+
if (this._style.showPerimeter) {
|
|
56834
|
+
styles.push(...this.createPerimeterStyles());
|
|
56835
|
+
}
|
|
56836
|
+
if (this._style.showPolygonIndex) {
|
|
56837
|
+
styles.push(...this.createIndexStyles());
|
|
56838
|
+
}
|
|
56839
|
+
if (this._style.textContent) {
|
|
56840
|
+
styles.push(this.createTextStyle());
|
|
56841
|
+
}
|
|
56842
|
+
return styles.length === 1 ? styles[0] : styles;
|
|
56843
|
+
}
|
|
56844
|
+
/**
|
|
56845
|
+
* 创建主多边形样式
|
|
56846
|
+
*/
|
|
56847
|
+
createMultiPolygonStyle() {
|
|
56848
|
+
return new Style$1({
|
|
56849
|
+
fill: new Fill$1({
|
|
56850
|
+
color: this.addOpacityToColor(this._style.fillColor || "#409eff", this._style.fillOpacity || 0.3)
|
|
56851
|
+
}),
|
|
56852
|
+
stroke: new Stroke$1({
|
|
56853
|
+
color: this.addOpacityToColor(this._style.strokeColor || "#409eff", this._style.strokeOpacity || 1),
|
|
56854
|
+
width: this._style.strokeWidth || 2,
|
|
56855
|
+
lineDash: this._style.strokeDash
|
|
56856
|
+
}),
|
|
56857
|
+
zIndex: this._style.zIndex || 0
|
|
56858
|
+
});
|
|
56859
|
+
}
|
|
56860
|
+
/**
|
|
56861
|
+
* 创建顶点样式
|
|
56862
|
+
*/
|
|
56863
|
+
createVertexStyles() {
|
|
56864
|
+
var _a2;
|
|
56865
|
+
const styles = [];
|
|
56866
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
56867
|
+
if (!geometry)
|
|
56868
|
+
return styles;
|
|
56869
|
+
const polygons = geometry.getPolygons();
|
|
56870
|
+
polygons.forEach((polygon) => {
|
|
56871
|
+
const coordinates2 = polygon.getCoordinates()[0];
|
|
56872
|
+
coordinates2.forEach((coord) => {
|
|
56873
|
+
styles.push(new Style$1({
|
|
56874
|
+
geometry: new ol.geom.Point(coord),
|
|
56875
|
+
image: new CircleStyle$1({
|
|
56876
|
+
radius: this._style.vertexSize || 6,
|
|
56877
|
+
fill: new Fill$1({
|
|
56878
|
+
color: this._style.vertexColor || "#409eff"
|
|
56879
|
+
}),
|
|
56880
|
+
stroke: new Stroke$1({
|
|
56881
|
+
color: "#ffffff",
|
|
56882
|
+
width: 2
|
|
56883
|
+
})
|
|
56884
|
+
}),
|
|
56885
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
56886
|
+
}));
|
|
56887
|
+
});
|
|
56888
|
+
});
|
|
56889
|
+
return styles;
|
|
56890
|
+
}
|
|
56891
|
+
/**
|
|
56892
|
+
* 创建面积标注样式
|
|
56893
|
+
*/
|
|
56894
|
+
createAreaStyles() {
|
|
56895
|
+
var _a2;
|
|
56896
|
+
const styles = [];
|
|
56897
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
56898
|
+
if (!geometry)
|
|
56899
|
+
return styles;
|
|
56900
|
+
const polygons = geometry.getPolygons();
|
|
56901
|
+
polygons.forEach((polygon, index2) => {
|
|
56902
|
+
const center = this.getPolygonCenter(polygon);
|
|
56903
|
+
if (center) {
|
|
56904
|
+
const area2 = this.calculatePolygonArea(polygon);
|
|
56905
|
+
const areaText = this.formatArea(area2);
|
|
56906
|
+
styles.push(new Style$1({
|
|
56907
|
+
geometry: new ol.geom.Point(center),
|
|
56908
|
+
text: new Text$1({
|
|
56909
|
+
text: areaText,
|
|
56910
|
+
font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
|
|
56911
|
+
fill: new Fill$1({
|
|
56912
|
+
color: this._style.textColor || "#333333"
|
|
56913
|
+
}),
|
|
56914
|
+
stroke: new Stroke$1({
|
|
56915
|
+
color: "#ffffff",
|
|
56916
|
+
width: 2
|
|
56917
|
+
}),
|
|
56918
|
+
textAlign: "center",
|
|
56919
|
+
textBaseline: "middle"
|
|
56920
|
+
}),
|
|
56921
|
+
zIndex: (this._style.zIndex || 0) + 2
|
|
56922
|
+
}));
|
|
56923
|
+
}
|
|
56924
|
+
});
|
|
56925
|
+
return styles;
|
|
56926
|
+
}
|
|
56927
|
+
/**
|
|
56928
|
+
* 创建周长标注样式
|
|
56929
|
+
*/
|
|
56930
|
+
createPerimeterStyles() {
|
|
56931
|
+
var _a2;
|
|
56932
|
+
const styles = [];
|
|
56933
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
56934
|
+
if (!geometry)
|
|
56935
|
+
return styles;
|
|
56936
|
+
const polygons = geometry.getPolygons();
|
|
56937
|
+
polygons.forEach((polygon, index2) => {
|
|
56938
|
+
const center = this.getPolygonCenter(polygon);
|
|
56939
|
+
if (center) {
|
|
56940
|
+
const perimeter = this.calculatePolygonPerimeter(polygon);
|
|
56941
|
+
const perimeterText = this.formatPerimeter(perimeter);
|
|
56942
|
+
const offsetCenter = [center[0], center[1] - 20];
|
|
56943
|
+
styles.push(new Style$1({
|
|
56944
|
+
geometry: new ol.geom.Point(offsetCenter),
|
|
56945
|
+
text: new Text$1({
|
|
56946
|
+
text: perimeterText,
|
|
56947
|
+
font: `${(this._style.fontSize || 12) - 2}px ${this._style.fontFamily || "Arial"}`,
|
|
56948
|
+
fill: new Fill$1({
|
|
56949
|
+
color: this._style.textColor || "#666666"
|
|
56950
|
+
}),
|
|
56951
|
+
stroke: new Stroke$1({
|
|
56952
|
+
color: "#ffffff",
|
|
56953
|
+
width: 2
|
|
56954
|
+
}),
|
|
56955
|
+
textAlign: "center",
|
|
56956
|
+
textBaseline: "middle"
|
|
56957
|
+
}),
|
|
56958
|
+
zIndex: (this._style.zIndex || 0) + 2
|
|
56959
|
+
}));
|
|
56960
|
+
}
|
|
56961
|
+
});
|
|
56962
|
+
return styles;
|
|
56963
|
+
}
|
|
56964
|
+
/**
|
|
56965
|
+
* 创建索引标注样式
|
|
56966
|
+
*/
|
|
56967
|
+
createIndexStyles() {
|
|
56968
|
+
var _a2;
|
|
56969
|
+
const styles = [];
|
|
56970
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
56971
|
+
if (!geometry)
|
|
56972
|
+
return styles;
|
|
56973
|
+
const polygons = geometry.getPolygons();
|
|
56974
|
+
polygons.forEach((polygon, index2) => {
|
|
56975
|
+
const center = this.getPolygonCenter(polygon);
|
|
56976
|
+
if (center) {
|
|
56977
|
+
styles.push(new Style$1({
|
|
56978
|
+
geometry: new ol.geom.Point(center),
|
|
56979
|
+
text: new Text$1({
|
|
56980
|
+
text: `${index2 + 1}`,
|
|
56981
|
+
font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
|
|
56982
|
+
fill: new Fill$1({
|
|
56983
|
+
color: this._style.indexColor || "#333333"
|
|
56984
|
+
}),
|
|
56985
|
+
stroke: new Stroke$1({
|
|
56986
|
+
color: "#ffffff",
|
|
56987
|
+
width: 3
|
|
56988
|
+
}),
|
|
56989
|
+
textAlign: "center",
|
|
56990
|
+
textBaseline: "middle",
|
|
56991
|
+
backgroundFill: new Fill$1({
|
|
56992
|
+
color: "rgba(255, 255, 255, 0.8)"
|
|
56993
|
+
}),
|
|
56994
|
+
padding: [2, 4, 2, 4]
|
|
56995
|
+
}),
|
|
56996
|
+
zIndex: (this._style.zIndex || 0) + 3
|
|
56997
|
+
}));
|
|
56998
|
+
}
|
|
56999
|
+
});
|
|
57000
|
+
return styles;
|
|
57001
|
+
}
|
|
57002
|
+
/**
|
|
57003
|
+
* 创建文字样式
|
|
57004
|
+
*/
|
|
57005
|
+
createTextStyle() {
|
|
57006
|
+
var _a2;
|
|
57007
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
57008
|
+
const center = geometry ? this.getMultiPolygonCenter() : [0, 0];
|
|
57009
|
+
return new Style$1({
|
|
57010
|
+
geometry: new ol.geom.Point(center),
|
|
57011
|
+
text: new Text$1({
|
|
57012
|
+
text: this._style.textContent || "",
|
|
57013
|
+
font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
|
|
57014
|
+
fill: new Fill$1({
|
|
57015
|
+
color: this._style.textColor || "#333333"
|
|
57016
|
+
}),
|
|
57017
|
+
stroke: new Stroke$1({
|
|
57018
|
+
color: "#ffffff",
|
|
57019
|
+
width: 2
|
|
57020
|
+
}),
|
|
57021
|
+
textAlign: this._style.textAlign || "center",
|
|
57022
|
+
textBaseline: this._style.textBaseline || "middle",
|
|
57023
|
+
offsetX: this._style.textOffsetX || 0,
|
|
57024
|
+
offsetY: this._style.textOffsetY || 0
|
|
57025
|
+
}),
|
|
57026
|
+
zIndex: (this._style.zIndex || 0) + 4
|
|
57027
|
+
});
|
|
57028
|
+
}
|
|
57029
|
+
/**
|
|
57030
|
+
* 更新要素几何
|
|
57031
|
+
*/
|
|
57032
|
+
updateFeatureGeometry() {
|
|
57033
|
+
if (!this.feature)
|
|
57034
|
+
return;
|
|
57035
|
+
const geometry = this.createMultiPolygonGeometry();
|
|
57036
|
+
this.feature.setGeometry(geometry);
|
|
57037
|
+
}
|
|
57038
|
+
/**
|
|
57039
|
+
* 创建选择样式
|
|
57040
|
+
*/
|
|
57041
|
+
createSelectionStyles() {
|
|
57042
|
+
const selectionColor = this._style.selectionColor || "#ff6b6b";
|
|
57043
|
+
const selectionWidth = this._style.selectionWidth || 3;
|
|
57044
|
+
const selectionOpacity = this._style.selectionOpacity || 0.8;
|
|
57045
|
+
const styles = [
|
|
57046
|
+
new Style$1({
|
|
57047
|
+
fill: new Fill$1({
|
|
57048
|
+
color: this.addOpacityToColor(selectionColor, 0.2)
|
|
57049
|
+
}),
|
|
57050
|
+
stroke: new Stroke$1({
|
|
57051
|
+
color: this.addOpacityToColor(selectionColor, selectionOpacity),
|
|
57052
|
+
width: selectionWidth,
|
|
57053
|
+
lineDash: [5, 5]
|
|
57054
|
+
}),
|
|
57055
|
+
zIndex: (this._style.zIndex || 0) + 10
|
|
57056
|
+
})
|
|
57057
|
+
];
|
|
57058
|
+
if (this._style.showEditHandles) {
|
|
57059
|
+
styles.push(...this.createEditHandleStyles());
|
|
57060
|
+
}
|
|
57061
|
+
return styles;
|
|
57062
|
+
}
|
|
57063
|
+
/**
|
|
57064
|
+
* 创建编辑控制点样式
|
|
57065
|
+
*/
|
|
57066
|
+
createEditHandleStyles() {
|
|
57067
|
+
var _a2;
|
|
57068
|
+
const styles = [];
|
|
57069
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
57070
|
+
if (!geometry)
|
|
57071
|
+
return styles;
|
|
57072
|
+
const handleSize = this._style.editHandleSize || 8;
|
|
57073
|
+
const handleColor = this._style.editHandleColor || "#ff6b6b";
|
|
57074
|
+
const polygons = geometry.getPolygons();
|
|
57075
|
+
polygons.forEach((polygon) => {
|
|
57076
|
+
const coordinates2 = polygon.getCoordinates()[0];
|
|
57077
|
+
coordinates2.forEach((coord) => {
|
|
57078
|
+
styles.push(new Style$1({
|
|
57079
|
+
geometry: new ol.geom.Point(coord),
|
|
57080
|
+
image: new CircleStyle$1({
|
|
57081
|
+
radius: handleSize,
|
|
57082
|
+
fill: new Fill$1({
|
|
57083
|
+
color: handleColor
|
|
57084
|
+
}),
|
|
57085
|
+
stroke: new Stroke$1({
|
|
57086
|
+
color: "#ffffff",
|
|
57087
|
+
width: 2
|
|
57088
|
+
})
|
|
57089
|
+
}),
|
|
57090
|
+
zIndex: (this._style.zIndex || 0) + 11
|
|
57091
|
+
}));
|
|
57092
|
+
});
|
|
57093
|
+
});
|
|
57094
|
+
return styles;
|
|
57095
|
+
}
|
|
57096
|
+
/**
|
|
57097
|
+
* 获取多边形中心点
|
|
57098
|
+
*/
|
|
57099
|
+
getPolygonCenter(polygon) {
|
|
57100
|
+
try {
|
|
57101
|
+
const extent = polygon.getExtent();
|
|
57102
|
+
return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
|
|
57103
|
+
} catch (error) {
|
|
57104
|
+
console.warn("计算多边形中心点失败:", error);
|
|
57105
|
+
return null;
|
|
57106
|
+
}
|
|
57107
|
+
}
|
|
57108
|
+
/**
|
|
57109
|
+
* 获取多多边形中心点
|
|
57110
|
+
*/
|
|
57111
|
+
getMultiPolygonCenter() {
|
|
57112
|
+
var _a2;
|
|
57113
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
57114
|
+
if (!geometry)
|
|
57115
|
+
return [0, 0];
|
|
57116
|
+
try {
|
|
57117
|
+
const extent = geometry.getExtent();
|
|
57118
|
+
return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
|
|
57119
|
+
} catch (error) {
|
|
57120
|
+
console.warn("计算多多边形中心点失败:", error);
|
|
57121
|
+
return [0, 0];
|
|
57122
|
+
}
|
|
57123
|
+
}
|
|
57124
|
+
/**
|
|
57125
|
+
* 计算多边形面积
|
|
57126
|
+
*/
|
|
57127
|
+
calculatePolygonArea(polygon) {
|
|
57128
|
+
try {
|
|
57129
|
+
return polygon.getArea();
|
|
57130
|
+
} catch (error) {
|
|
57131
|
+
console.warn("计算多边形面积失败:", error);
|
|
57132
|
+
return 0;
|
|
57133
|
+
}
|
|
57134
|
+
}
|
|
57135
|
+
/**
|
|
57136
|
+
* 计算多边形周长
|
|
57137
|
+
*/
|
|
57138
|
+
calculatePolygonPerimeter(polygon) {
|
|
57139
|
+
try {
|
|
57140
|
+
const coordinates2 = polygon.getCoordinates()[0];
|
|
57141
|
+
let perimeter = 0;
|
|
57142
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
57143
|
+
const dx = coordinates2[i + 1][0] - coordinates2[i][0];
|
|
57144
|
+
const dy = coordinates2[i + 1][1] - coordinates2[i][1];
|
|
57145
|
+
perimeter += Math.sqrt(dx * dx + dy * dy);
|
|
57146
|
+
}
|
|
57147
|
+
return perimeter;
|
|
57148
|
+
} catch (error) {
|
|
57149
|
+
console.warn("计算多边形周长失败:", error);
|
|
57150
|
+
return 0;
|
|
57151
|
+
}
|
|
57152
|
+
}
|
|
57153
|
+
/**
|
|
57154
|
+
* 格式化面积显示
|
|
57155
|
+
*/
|
|
57156
|
+
formatArea(area2) {
|
|
57157
|
+
const unit = this._style.areaUnit || "m²";
|
|
57158
|
+
const precision = this._style.areaPrecision || 2;
|
|
57159
|
+
switch (unit) {
|
|
57160
|
+
case "km²":
|
|
57161
|
+
return `${(area2 / 1e6).toFixed(precision)} km²`;
|
|
57162
|
+
case "ha":
|
|
57163
|
+
return `${(area2 / 1e4).toFixed(precision)} ha`;
|
|
57164
|
+
case "acre":
|
|
57165
|
+
return `${(area2 / 4046.86).toFixed(precision)} acre`;
|
|
57166
|
+
case "ft²":
|
|
57167
|
+
return `${(area2 * 10.764).toFixed(precision)} ft²`;
|
|
57168
|
+
default:
|
|
57169
|
+
return `${area2.toFixed(precision)} m²`;
|
|
57170
|
+
}
|
|
57171
|
+
}
|
|
57172
|
+
/**
|
|
57173
|
+
* 格式化周长显示
|
|
57174
|
+
*/
|
|
57175
|
+
formatPerimeter(perimeter) {
|
|
57176
|
+
const unit = this._style.perimeterUnit || "m";
|
|
57177
|
+
const precision = this._style.perimeterPrecision || 2;
|
|
57178
|
+
switch (unit) {
|
|
57179
|
+
case "km":
|
|
57180
|
+
return `${(perimeter / 1e3).toFixed(precision)} km`;
|
|
57181
|
+
case "mi":
|
|
57182
|
+
return `${(perimeter / 1609.34).toFixed(precision)} mi`;
|
|
57183
|
+
case "ft":
|
|
57184
|
+
return `${(perimeter * 3.28084).toFixed(precision)} ft`;
|
|
57185
|
+
default:
|
|
57186
|
+
return `${perimeter.toFixed(precision)} m`;
|
|
57187
|
+
}
|
|
57188
|
+
}
|
|
57189
|
+
/**
|
|
57190
|
+
* 设置坐标
|
|
57191
|
+
*/
|
|
57192
|
+
setCoordinates(coordinates2) {
|
|
57193
|
+
this._config.coordinates = coordinates2;
|
|
57194
|
+
this.updateFeatureGeometry();
|
|
57195
|
+
this.updateStyle();
|
|
57196
|
+
}
|
|
57197
|
+
/**
|
|
57198
|
+
* 获取坐标
|
|
57199
|
+
*/
|
|
57200
|
+
getCoordinates() {
|
|
57201
|
+
return this._config.coordinates;
|
|
57202
|
+
}
|
|
57203
|
+
/**
|
|
57204
|
+
* 获取多边形数量
|
|
57205
|
+
*/
|
|
57206
|
+
getPolygonCount() {
|
|
57207
|
+
return this._config.coordinates.length;
|
|
57208
|
+
}
|
|
57209
|
+
/**
|
|
57210
|
+
* 添加多边形
|
|
57211
|
+
*/
|
|
57212
|
+
addPolygon(polygonCoordinates) {
|
|
57213
|
+
this._config.coordinates.push(polygonCoordinates);
|
|
57214
|
+
this.updateFeatureGeometry();
|
|
57215
|
+
this.updateStyle();
|
|
57216
|
+
}
|
|
57217
|
+
/**
|
|
57218
|
+
* 移除多边形
|
|
57219
|
+
*/
|
|
57220
|
+
removePolygon(index2) {
|
|
57221
|
+
if (index2 >= 0 && index2 < this._config.coordinates.length) {
|
|
57222
|
+
this._config.coordinates.splice(index2, 1);
|
|
57223
|
+
this.updateFeatureGeometry();
|
|
57224
|
+
this.updateStyle();
|
|
57225
|
+
return true;
|
|
57226
|
+
}
|
|
57227
|
+
return false;
|
|
57228
|
+
}
|
|
57229
|
+
/**
|
|
57230
|
+
* 获取总面积
|
|
57231
|
+
*/
|
|
57232
|
+
getTotalArea(unit = "m²") {
|
|
57233
|
+
var _a2;
|
|
57234
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
57235
|
+
if (!geometry)
|
|
57236
|
+
return 0;
|
|
57237
|
+
const polygons = geometry.getPolygons();
|
|
57238
|
+
let totalArea = 0;
|
|
57239
|
+
polygons.forEach((polygon) => {
|
|
57240
|
+
totalArea += this.calculatePolygonArea(polygon);
|
|
57241
|
+
});
|
|
57242
|
+
switch (unit) {
|
|
57243
|
+
case "km²":
|
|
57244
|
+
return totalArea / 1e6;
|
|
57245
|
+
case "ha":
|
|
57246
|
+
return totalArea / 1e4;
|
|
57247
|
+
case "acre":
|
|
57248
|
+
return totalArea / 4046.86;
|
|
57249
|
+
case "ft²":
|
|
57250
|
+
return totalArea * 10.764;
|
|
57251
|
+
default:
|
|
57252
|
+
return totalArea;
|
|
57253
|
+
}
|
|
57254
|
+
}
|
|
57255
|
+
/**
|
|
57256
|
+
* 获取总周长
|
|
57257
|
+
*/
|
|
57258
|
+
getTotalPerimeter(unit = "m") {
|
|
57259
|
+
var _a2;
|
|
57260
|
+
const geometry = (_a2 = this.feature) == null ? void 0 : _a2.getGeometry();
|
|
57261
|
+
if (!geometry)
|
|
57262
|
+
return 0;
|
|
57263
|
+
const polygons = geometry.getPolygons();
|
|
57264
|
+
let totalPerimeter = 0;
|
|
57265
|
+
polygons.forEach((polygon) => {
|
|
57266
|
+
totalPerimeter += this.calculatePolygonPerimeter(polygon);
|
|
57267
|
+
});
|
|
57268
|
+
switch (unit) {
|
|
57269
|
+
case "km":
|
|
57270
|
+
return totalPerimeter / 1e3;
|
|
57271
|
+
case "mi":
|
|
57272
|
+
return totalPerimeter / 1609.34;
|
|
57273
|
+
case "ft":
|
|
57274
|
+
return totalPerimeter * 3.28084;
|
|
57275
|
+
default:
|
|
57276
|
+
return totalPerimeter;
|
|
57277
|
+
}
|
|
57278
|
+
}
|
|
57279
|
+
/**
|
|
57280
|
+
* 设置填充样式
|
|
57281
|
+
*/
|
|
57282
|
+
setFillStyle(options) {
|
|
57283
|
+
if (options.color)
|
|
57284
|
+
this._style.fillColor = options.color;
|
|
57285
|
+
if (options.opacity !== void 0)
|
|
57286
|
+
this._style.fillOpacity = options.opacity;
|
|
57287
|
+
this.updateStyle();
|
|
57288
|
+
}
|
|
57289
|
+
/**
|
|
57290
|
+
* 设置边框样式
|
|
57291
|
+
*/
|
|
57292
|
+
setStrokeStyle(options) {
|
|
57293
|
+
if (options.color)
|
|
57294
|
+
this._style.strokeColor = options.color;
|
|
57295
|
+
if (options.width !== void 0)
|
|
57296
|
+
this._style.strokeWidth = options.width;
|
|
57297
|
+
if (options.dash)
|
|
57298
|
+
this._style.strokeDash = options.dash;
|
|
57299
|
+
if (options.opacity !== void 0)
|
|
57300
|
+
this._style.strokeOpacity = options.opacity;
|
|
57301
|
+
this.updateStyle();
|
|
57302
|
+
}
|
|
57303
|
+
/**
|
|
57304
|
+
* 设置多边形索引显示
|
|
57305
|
+
*/
|
|
57306
|
+
setPolygonIndexVisible(visible, options) {
|
|
57307
|
+
this._style.showPolygonIndex = visible;
|
|
57308
|
+
if (options == null ? void 0 : options.fontSize)
|
|
57309
|
+
this._style.indexFontSize = options.fontSize;
|
|
57310
|
+
if (options == null ? void 0 : options.color)
|
|
57311
|
+
this._style.indexColor = options.color;
|
|
57312
|
+
this.updateStyle();
|
|
57313
|
+
}
|
|
57314
|
+
/**
|
|
57315
|
+
* 创建实例
|
|
57316
|
+
*/
|
|
57317
|
+
createInstance(config) {
|
|
57318
|
+
return new MultiPolygonDrawing(config);
|
|
57319
|
+
}
|
|
57320
|
+
/**
|
|
57321
|
+
* 从JSON反序列化
|
|
57322
|
+
*/
|
|
57323
|
+
static fromJSON(data) {
|
|
57324
|
+
const config = {
|
|
57325
|
+
id: data.id,
|
|
57326
|
+
type: "multipolygon",
|
|
57327
|
+
name: data.name,
|
|
57328
|
+
coordinates: data.coordinates,
|
|
57329
|
+
properties: data.properties || {},
|
|
57330
|
+
style: data.style || {},
|
|
57331
|
+
visible: data.visible !== false
|
|
57332
|
+
};
|
|
57333
|
+
return new MultiPolygonDrawing(config);
|
|
57334
|
+
}
|
|
57335
|
+
/**
|
|
57336
|
+
* 从GeoJSON创建MultiPolygonDrawing
|
|
57337
|
+
*/
|
|
57338
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
57339
|
+
var _a2;
|
|
57340
|
+
if (geoJsonFeature.geometry.type !== "MultiPolygon") {
|
|
57341
|
+
throw new Error("GeoJSON feature must be of type MultiPolygon");
|
|
57342
|
+
}
|
|
57343
|
+
const config = {
|
|
57344
|
+
id: geoJsonFeature.id || `multipolygon_${Date.now()}`,
|
|
57345
|
+
type: "multipolygon",
|
|
57346
|
+
name: ((_a2 = geoJsonFeature.properties) == null ? void 0 : _a2.name) || "多多边形",
|
|
57347
|
+
coordinates: geoJsonFeature.geometry.coordinates,
|
|
57348
|
+
properties: geoJsonFeature.properties || {},
|
|
57349
|
+
style: {},
|
|
57350
|
+
visible: true
|
|
57351
|
+
};
|
|
57352
|
+
return new MultiPolygonDrawing(config);
|
|
57353
|
+
}
|
|
57354
|
+
/**
|
|
57355
|
+
* 添加透明度到颜色
|
|
57356
|
+
*/
|
|
57357
|
+
addOpacityToColor(color2, opacity2) {
|
|
57358
|
+
if (opacity2 >= 1)
|
|
57359
|
+
return color2;
|
|
57360
|
+
if (color2.startsWith("#")) {
|
|
57361
|
+
const hex = color2.slice(1);
|
|
57362
|
+
const r = parseInt(hex.substr(0, 2), 16);
|
|
57363
|
+
const g2 = parseInt(hex.substr(2, 2), 16);
|
|
57364
|
+
const b2 = parseInt(hex.substr(4, 2), 16);
|
|
57365
|
+
return `rgba(${r}, ${g2}, ${b2}, ${opacity2})`;
|
|
57366
|
+
}
|
|
57367
|
+
if (color2.startsWith("rgba")) {
|
|
57368
|
+
return color2.replace(/[\d\.]+\)$/g, `${opacity2})`);
|
|
57369
|
+
}
|
|
57370
|
+
if (color2.startsWith("rgb")) {
|
|
57371
|
+
return color2.replace("rgb", "rgba").replace(")", `, ${opacity2})`);
|
|
57372
|
+
}
|
|
57373
|
+
return color2;
|
|
57374
|
+
}
|
|
57375
|
+
}
|
|
57376
|
+
class MultiPolygonDrawingFactory {
|
|
57377
|
+
static create(config) {
|
|
57378
|
+
return new MultiPolygonDrawing(config);
|
|
57379
|
+
}
|
|
57380
|
+
static getType() {
|
|
57381
|
+
return "multipolygon";
|
|
57382
|
+
}
|
|
57383
|
+
static getSupportedTypes() {
|
|
57384
|
+
return ["multipolygon", "multi-polygon"];
|
|
57385
|
+
}
|
|
57386
|
+
/**
|
|
57387
|
+
* 从GeoJSON创建
|
|
57388
|
+
*/
|
|
57389
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
57390
|
+
return MultiPolygonDrawing.fromGeoJSON(geoJsonFeature);
|
|
57391
|
+
}
|
|
57392
|
+
/**
|
|
57393
|
+
* 创建预设样式的多多边形
|
|
57394
|
+
*/
|
|
57395
|
+
static createPreset(coordinates2, preset, options) {
|
|
57396
|
+
const presetStyles = {
|
|
57397
|
+
default: { fillColor: "#409eff", strokeColor: "#409eff" },
|
|
57398
|
+
highlight: { fillColor: "#e6a23c", strokeColor: "#e6a23c" },
|
|
57399
|
+
warning: { fillColor: "#f56c6c", strokeColor: "#f56c6c" },
|
|
57400
|
+
success: { fillColor: "#67c23a", strokeColor: "#67c23a" },
|
|
57401
|
+
danger: { fillColor: "#f56c6c", strokeColor: "#f56c6c" }
|
|
57402
|
+
};
|
|
57403
|
+
const style = presetStyles[preset];
|
|
57404
|
+
const config = {
|
|
57405
|
+
type: "multipolygon",
|
|
57406
|
+
coordinates: coordinates2,
|
|
57407
|
+
name: (options == null ? void 0 : options.name) || "多多边形",
|
|
57408
|
+
style: {
|
|
57409
|
+
...style,
|
|
57410
|
+
fillOpacity: 0.3,
|
|
57411
|
+
strokeWidth: 2,
|
|
57412
|
+
textContent: options == null ? void 0 : options.text,
|
|
57413
|
+
showArea: (options == null ? void 0 : options.showArea) || false,
|
|
57414
|
+
showPerimeter: (options == null ? void 0 : options.showPerimeter) || false,
|
|
57415
|
+
showPolygonIndex: (options == null ? void 0 : options.showIndex) || false
|
|
57416
|
+
}
|
|
57417
|
+
};
|
|
57418
|
+
return new MultiPolygonDrawing(config);
|
|
57419
|
+
}
|
|
57420
|
+
}
|
|
57421
|
+
class MultiPointDrawing extends BaseDrawing {
|
|
57422
|
+
constructor(config) {
|
|
57423
|
+
super(config);
|
|
57424
|
+
__publicField(this, "_config");
|
|
57425
|
+
__publicField(this, "_style");
|
|
57426
|
+
__publicField(this, "_animationFrame");
|
|
57427
|
+
__publicField(this, "_rippleAnimations", /* @__PURE__ */ new Map());
|
|
57428
|
+
this._config = config;
|
|
57429
|
+
this._style = {
|
|
57430
|
+
color: "#409eff",
|
|
57431
|
+
size: 8,
|
|
57432
|
+
opacity: 1,
|
|
57433
|
+
strokeColor: "#ffffff",
|
|
57434
|
+
strokeWidth: 2,
|
|
57435
|
+
pointStyle: "circle",
|
|
57436
|
+
iconScale: 1,
|
|
57437
|
+
iconAnchor: [0.5, 1],
|
|
57438
|
+
iconOffset: [0, 0],
|
|
57439
|
+
iconRotation: 0,
|
|
57440
|
+
rippleRadius: 20,
|
|
57441
|
+
rippleColor: "#409eff",
|
|
57442
|
+
rippleOpacity: 0.6,
|
|
57443
|
+
rippleSpeed: 1e3,
|
|
57444
|
+
gifScale: 1,
|
|
57445
|
+
gifAnchor: [0.5, 0.5],
|
|
57446
|
+
shapePoints: 5,
|
|
57447
|
+
shapeRadius: 10,
|
|
57448
|
+
shapeRadius2: 5,
|
|
57449
|
+
shapeAngle: 0,
|
|
57450
|
+
showPointIndex: false,
|
|
57451
|
+
indexFontSize: 12,
|
|
57452
|
+
indexColor: "#333333",
|
|
57453
|
+
indexOffset: [0, -15],
|
|
57454
|
+
showConnectingLines: false,
|
|
57455
|
+
connectingLineColor: "#409eff",
|
|
57456
|
+
connectingLineWidth: 1,
|
|
57457
|
+
connectingLineOpacity: 0.5,
|
|
57458
|
+
enableClustering: false,
|
|
57459
|
+
clusterDistance: 50,
|
|
57460
|
+
clusterMinSize: 20,
|
|
57461
|
+
clusterMaxSize: 40,
|
|
57462
|
+
clusterColor: "#409eff",
|
|
57463
|
+
showCoordinates: false,
|
|
57464
|
+
coordinateFormat: "decimal",
|
|
57465
|
+
coordinatePrecision: 6,
|
|
57466
|
+
...config.style
|
|
57467
|
+
};
|
|
57468
|
+
}
|
|
57469
|
+
/**
|
|
57470
|
+
* 创建要素
|
|
57471
|
+
*/
|
|
57472
|
+
createFeature() {
|
|
57473
|
+
const geometry = this.createMultiPointGeometry();
|
|
57474
|
+
this.feature = new Feature$2({
|
|
57475
|
+
geometry,
|
|
57476
|
+
id: this.getId(),
|
|
57477
|
+
type: this.getType(),
|
|
57478
|
+
name: this.getName(),
|
|
57479
|
+
properties: this.getProperties()
|
|
57480
|
+
});
|
|
57481
|
+
}
|
|
57482
|
+
/**
|
|
57483
|
+
* 创建多点几何
|
|
57484
|
+
*/
|
|
57485
|
+
createMultiPointGeometry() {
|
|
57486
|
+
const coordinates2 = this._config.coordinates;
|
|
57487
|
+
if (!coordinates2 || coordinates2.length === 0) {
|
|
57488
|
+
throw new Error("MultiPoint coordinates cannot be empty");
|
|
57489
|
+
}
|
|
57490
|
+
return new MultiPoint$1(coordinates2);
|
|
57491
|
+
}
|
|
57492
|
+
/**
|
|
57493
|
+
* 创建样式
|
|
57494
|
+
*/
|
|
57495
|
+
createStyle() {
|
|
57496
|
+
const styles = [];
|
|
57497
|
+
if (this._style.showConnectingLines && this._config.coordinates.length > 1) {
|
|
57498
|
+
styles.push(...this.createConnectingLineStyles());
|
|
57499
|
+
}
|
|
57500
|
+
if (this._style.pointStyle === "ripple" || this._style.pointStyle === "gif") {
|
|
57501
|
+
styles.push(...this.createSimplifiedPointStyles());
|
|
57502
|
+
} else {
|
|
57503
|
+
styles.push(...this.createPointStyles());
|
|
57504
|
+
}
|
|
57505
|
+
if (this._style.showPointIndex && this._config.coordinates.length <= 20) {
|
|
57506
|
+
styles.push(...this.createIndexStyles());
|
|
57507
|
+
}
|
|
57508
|
+
if (this._style.showCoordinates && this._config.coordinates.length <= 10) {
|
|
57509
|
+
styles.push(...this.createCoordinateStyles());
|
|
57510
|
+
}
|
|
57511
|
+
if (this._style.textContent) {
|
|
57512
|
+
styles.push(this.createTextStyle());
|
|
57513
|
+
}
|
|
57514
|
+
return styles.length === 1 ? styles[0] : styles;
|
|
57515
|
+
}
|
|
57516
|
+
/**
|
|
57517
|
+
* 创建简化的点样式(用于性能优化)
|
|
57518
|
+
*/
|
|
57519
|
+
createSimplifiedPointStyles() {
|
|
57520
|
+
const styles = [];
|
|
57521
|
+
const coordinates2 = this._config.coordinates;
|
|
57522
|
+
const commonStyle = new Style$1({
|
|
57523
|
+
image: new CircleStyle$1({
|
|
57524
|
+
radius: this._style.size || 6,
|
|
57525
|
+
fill: new Fill$1({
|
|
57526
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 0.8)
|
|
57527
|
+
}),
|
|
57528
|
+
stroke: new Stroke$1({
|
|
57529
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57530
|
+
width: this._style.strokeWidth || 1
|
|
57531
|
+
})
|
|
57532
|
+
}),
|
|
57533
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57534
|
+
});
|
|
57535
|
+
coordinates2.forEach((coord) => {
|
|
57536
|
+
const pointGeometry = new Point$1(coord);
|
|
57537
|
+
const style = commonStyle.clone();
|
|
57538
|
+
style.setGeometry(pointGeometry);
|
|
57539
|
+
styles.push(style);
|
|
57540
|
+
});
|
|
57541
|
+
return styles;
|
|
57542
|
+
}
|
|
57543
|
+
/**
|
|
57544
|
+
* 创建点样式
|
|
57545
|
+
*/
|
|
57546
|
+
createPointStyles() {
|
|
57547
|
+
const styles = [];
|
|
57548
|
+
const coordinates2 = this._config.coordinates;
|
|
57549
|
+
coordinates2.forEach((coord, index2) => {
|
|
57550
|
+
const pointStyle = this.createSinglePointStyle(coord, index2);
|
|
57551
|
+
if (pointStyle) {
|
|
57552
|
+
styles.push(pointStyle);
|
|
57553
|
+
}
|
|
57554
|
+
if (this._style.pointStyle === "ripple" && coordinates2.length <= 10) {
|
|
57555
|
+
styles.push(...this.createRippleStyles(coord, index2));
|
|
57556
|
+
}
|
|
57557
|
+
});
|
|
57558
|
+
return styles;
|
|
57559
|
+
}
|
|
57560
|
+
/**
|
|
57561
|
+
* 创建单个点样式
|
|
57562
|
+
*/
|
|
57563
|
+
createSinglePointStyle(coordinate, index2) {
|
|
57564
|
+
const pointGeometry = new Point$1(coordinate);
|
|
57565
|
+
switch (this._style.pointStyle) {
|
|
57566
|
+
case "circle":
|
|
57567
|
+
return new Style$1({
|
|
57568
|
+
geometry: pointGeometry,
|
|
57569
|
+
image: new CircleStyle$1({
|
|
57570
|
+
radius: this._style.size || 8,
|
|
57571
|
+
fill: new Fill$1({
|
|
57572
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57573
|
+
}),
|
|
57574
|
+
stroke: new Stroke$1({
|
|
57575
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57576
|
+
width: this._style.strokeWidth || 2
|
|
57577
|
+
})
|
|
57578
|
+
}),
|
|
57579
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57580
|
+
});
|
|
57581
|
+
case "square":
|
|
57582
|
+
return new Style$1({
|
|
57583
|
+
geometry: pointGeometry,
|
|
57584
|
+
image: new RegularShape$1({
|
|
57585
|
+
points: 4,
|
|
57586
|
+
radius: this._style.size || 8,
|
|
57587
|
+
angle: Math.PI / 4,
|
|
57588
|
+
fill: new Fill$1({
|
|
57589
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57590
|
+
}),
|
|
57591
|
+
stroke: new Stroke$1({
|
|
57592
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57593
|
+
width: this._style.strokeWidth || 2
|
|
57594
|
+
})
|
|
57595
|
+
}),
|
|
57596
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57597
|
+
});
|
|
57598
|
+
case "triangle":
|
|
57599
|
+
return new Style$1({
|
|
57600
|
+
geometry: pointGeometry,
|
|
57601
|
+
image: new RegularShape$1({
|
|
57602
|
+
points: 3,
|
|
57603
|
+
radius: this._style.size || 8,
|
|
57604
|
+
angle: 0,
|
|
57605
|
+
fill: new Fill$1({
|
|
57606
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57607
|
+
}),
|
|
57608
|
+
stroke: new Stroke$1({
|
|
57609
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57610
|
+
width: this._style.strokeWidth || 2
|
|
57611
|
+
})
|
|
57612
|
+
}),
|
|
57613
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57614
|
+
});
|
|
57615
|
+
case "star":
|
|
57616
|
+
return new Style$1({
|
|
57617
|
+
geometry: pointGeometry,
|
|
57618
|
+
image: new RegularShape$1({
|
|
57619
|
+
points: this._style.shapePoints || 5,
|
|
57620
|
+
radius: this._style.shapeRadius || 10,
|
|
57621
|
+
radius2: this._style.shapeRadius2 || 5,
|
|
57622
|
+
angle: this._style.shapeAngle || 0,
|
|
57623
|
+
fill: new Fill$1({
|
|
57624
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57625
|
+
}),
|
|
57626
|
+
stroke: new Stroke$1({
|
|
57627
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57628
|
+
width: this._style.strokeWidth || 2
|
|
57629
|
+
})
|
|
57630
|
+
}),
|
|
57631
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57632
|
+
});
|
|
57633
|
+
case "cross":
|
|
57634
|
+
return new Style$1({
|
|
57635
|
+
geometry: pointGeometry,
|
|
57636
|
+
image: new RegularShape$1({
|
|
57637
|
+
points: 4,
|
|
57638
|
+
radius: this._style.size || 8,
|
|
57639
|
+
radius2: 0,
|
|
57640
|
+
angle: 0,
|
|
57641
|
+
stroke: new Stroke$1({
|
|
57642
|
+
color: this._style.color || "#409eff",
|
|
57643
|
+
width: this._style.strokeWidth || 2
|
|
57644
|
+
})
|
|
57645
|
+
}),
|
|
57646
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57647
|
+
});
|
|
57648
|
+
case "x":
|
|
57649
|
+
return new Style$1({
|
|
57650
|
+
geometry: pointGeometry,
|
|
57651
|
+
image: new RegularShape$1({
|
|
57652
|
+
points: 4,
|
|
57653
|
+
radius: this._style.size || 8,
|
|
57654
|
+
radius2: 0,
|
|
57655
|
+
angle: Math.PI / 4,
|
|
57656
|
+
stroke: new Stroke$1({
|
|
57657
|
+
color: this._style.color || "#409eff",
|
|
57658
|
+
width: this._style.strokeWidth || 2
|
|
57659
|
+
})
|
|
57660
|
+
}),
|
|
57661
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57662
|
+
});
|
|
57663
|
+
case "icon":
|
|
57664
|
+
if (this._style.iconSrc) {
|
|
57665
|
+
return new Style$1({
|
|
57666
|
+
geometry: pointGeometry,
|
|
57667
|
+
image: new Icon$1({
|
|
57668
|
+
src: this._style.iconSrc,
|
|
57669
|
+
scale: this._style.iconScale || 1,
|
|
57670
|
+
anchor: this._style.iconAnchor || [0.5, 1],
|
|
57671
|
+
offset: this._style.iconOffset || [0, 0],
|
|
57672
|
+
rotation: this._style.iconRotation || 0
|
|
57673
|
+
}),
|
|
57674
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57675
|
+
});
|
|
57676
|
+
}
|
|
57677
|
+
break;
|
|
57678
|
+
case "gif":
|
|
57679
|
+
if (this._style.gifSrc) {
|
|
57680
|
+
return new Style$1({
|
|
57681
|
+
geometry: pointGeometry,
|
|
57682
|
+
image: new Icon$1({
|
|
57683
|
+
src: this._style.gifSrc,
|
|
57684
|
+
scale: this._style.gifScale || 1,
|
|
57685
|
+
anchor: this._style.gifAnchor || [0.5, 0.5]
|
|
57686
|
+
}),
|
|
57687
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57688
|
+
});
|
|
57689
|
+
}
|
|
57690
|
+
break;
|
|
57691
|
+
case "ripple":
|
|
57692
|
+
return new Style$1({
|
|
57693
|
+
geometry: pointGeometry,
|
|
57694
|
+
image: new CircleStyle$1({
|
|
57695
|
+
radius: this._style.size || 8,
|
|
57696
|
+
fill: new Fill$1({
|
|
57697
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57698
|
+
}),
|
|
57699
|
+
stroke: new Stroke$1({
|
|
57700
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57701
|
+
width: this._style.strokeWidth || 2
|
|
57702
|
+
})
|
|
57703
|
+
}),
|
|
57704
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57705
|
+
});
|
|
57706
|
+
default:
|
|
57707
|
+
return new Style$1({
|
|
57708
|
+
geometry: pointGeometry,
|
|
57709
|
+
image: new CircleStyle$1({
|
|
57710
|
+
radius: this._style.size || 8,
|
|
57711
|
+
fill: new Fill$1({
|
|
57712
|
+
color: this.addOpacityToColor(this._style.color || "#409eff", this._style.opacity || 1)
|
|
57713
|
+
}),
|
|
57714
|
+
stroke: new Stroke$1({
|
|
57715
|
+
color: this._style.strokeColor || "#ffffff",
|
|
57716
|
+
width: this._style.strokeWidth || 2
|
|
57717
|
+
})
|
|
57718
|
+
}),
|
|
57719
|
+
zIndex: (this._style.zIndex || 0) + 1
|
|
57720
|
+
});
|
|
57721
|
+
}
|
|
57722
|
+
return null;
|
|
57723
|
+
}
|
|
57724
|
+
/**
|
|
57725
|
+
* 创建扩散样式
|
|
57726
|
+
*/
|
|
57727
|
+
createRippleStyles(coordinate, index2) {
|
|
57728
|
+
const styles = [];
|
|
57729
|
+
const rippleCount = 3;
|
|
57730
|
+
const maxRadius = this._style.rippleRadius || 20;
|
|
57731
|
+
const baseRadius = this._style.size || 8;
|
|
57732
|
+
for (let i = 0; i < rippleCount; i++) {
|
|
57733
|
+
const radius = baseRadius + (maxRadius - baseRadius) * (i + 1) / rippleCount;
|
|
57734
|
+
const opacity2 = (this._style.rippleOpacity || 0.6) * (1 - i / rippleCount);
|
|
57735
|
+
styles.push(new Style$1({
|
|
57736
|
+
geometry: new Point$1(coordinate),
|
|
57737
|
+
image: new CircleStyle$1({
|
|
57738
|
+
radius,
|
|
57739
|
+
stroke: new Stroke$1({
|
|
57740
|
+
color: this.addOpacityToColor(this._style.rippleColor || this._style.color || "#409eff", opacity2),
|
|
57741
|
+
width: 2
|
|
57742
|
+
})
|
|
57743
|
+
}),
|
|
57744
|
+
zIndex: this._style.zIndex || 0
|
|
57745
|
+
}));
|
|
57746
|
+
}
|
|
57747
|
+
return styles;
|
|
57748
|
+
}
|
|
57749
|
+
/**
|
|
57750
|
+
* 创建连接线样式
|
|
57751
|
+
*/
|
|
57752
|
+
createConnectingLineStyles() {
|
|
57753
|
+
const styles = [];
|
|
57754
|
+
const coordinates2 = this._config.coordinates;
|
|
57755
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
57756
|
+
const lineGeometry = new ol.geom.LineString([coordinates2[i], coordinates2[i + 1]]);
|
|
57757
|
+
styles.push(new Style$1({
|
|
57758
|
+
geometry: lineGeometry,
|
|
57759
|
+
stroke: new Stroke$1({
|
|
57760
|
+
color: this.addOpacityToColor(
|
|
57761
|
+
this._style.connectingLineColor || "#409eff",
|
|
57762
|
+
this._style.connectingLineOpacity || 0.5
|
|
57763
|
+
),
|
|
57764
|
+
width: this._style.connectingLineWidth || 1,
|
|
57765
|
+
lineDash: this._style.connectingLineDash
|
|
57766
|
+
}),
|
|
57767
|
+
zIndex: (this._style.zIndex || 0) - 1
|
|
57768
|
+
}));
|
|
57769
|
+
}
|
|
57770
|
+
return styles;
|
|
57771
|
+
}
|
|
57772
|
+
/**
|
|
57773
|
+
* 创建索引标注样式
|
|
57774
|
+
*/
|
|
57775
|
+
createIndexStyles() {
|
|
57776
|
+
const styles = [];
|
|
57777
|
+
const coordinates2 = this._config.coordinates;
|
|
57778
|
+
coordinates2.forEach((coord, index2) => {
|
|
57779
|
+
var _a2, _b2;
|
|
57780
|
+
const offsetCoord = [
|
|
57781
|
+
coord[0] + (((_a2 = this._style.indexOffset) == null ? void 0 : _a2[0]) || 0),
|
|
57782
|
+
coord[1] + (((_b2 = this._style.indexOffset) == null ? void 0 : _b2[1]) || -15)
|
|
57783
|
+
];
|
|
57784
|
+
styles.push(new Style$1({
|
|
57785
|
+
geometry: new Point$1(offsetCoord),
|
|
57786
|
+
text: new Text$1({
|
|
57787
|
+
text: `${index2 + 1}`,
|
|
57788
|
+
font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
|
|
57789
|
+
fill: new Fill$1({
|
|
57790
|
+
color: this._style.indexColor || "#333333"
|
|
57791
|
+
}),
|
|
57792
|
+
stroke: new Stroke$1({
|
|
57793
|
+
color: "#ffffff",
|
|
57794
|
+
width: 2
|
|
57795
|
+
}),
|
|
57796
|
+
textAlign: "center",
|
|
57797
|
+
textBaseline: "middle",
|
|
57798
|
+
backgroundFill: new Fill$1({
|
|
57799
|
+
color: "rgba(255, 255, 255, 0.8)"
|
|
57800
|
+
}),
|
|
57801
|
+
padding: [2, 4, 2, 4]
|
|
57802
|
+
}),
|
|
57803
|
+
zIndex: (this._style.zIndex || 0) + 2
|
|
57804
|
+
}));
|
|
57805
|
+
});
|
|
57806
|
+
return styles;
|
|
57807
|
+
}
|
|
57808
|
+
/**
|
|
57809
|
+
* 创建坐标标注样式
|
|
57810
|
+
*/
|
|
57811
|
+
createCoordinateStyles() {
|
|
57812
|
+
const styles = [];
|
|
57813
|
+
const coordinates2 = this._config.coordinates;
|
|
57814
|
+
coordinates2.forEach((coord, index2) => {
|
|
57815
|
+
var _a2;
|
|
57816
|
+
const coordText = this.formatCoordinate(coord);
|
|
57817
|
+
const offsetCoord = [
|
|
57818
|
+
coord[0],
|
|
57819
|
+
coord[1] + (((_a2 = this._style.indexOffset) == null ? void 0 : _a2[1]) || -15) - 20
|
|
57820
|
+
];
|
|
57821
|
+
styles.push(new Style$1({
|
|
57822
|
+
geometry: new Point$1(offsetCoord),
|
|
57823
|
+
text: new Text$1({
|
|
57824
|
+
text: coordText,
|
|
57825
|
+
font: `${(this._style.fontSize || 12) - 2}px ${this._style.fontFamily || "Arial"}`,
|
|
57826
|
+
fill: new Fill$1({
|
|
57827
|
+
color: this._style.textColor || "#666666"
|
|
57828
|
+
}),
|
|
57829
|
+
stroke: new Stroke$1({
|
|
57830
|
+
color: "#ffffff",
|
|
57831
|
+
width: 1
|
|
57832
|
+
}),
|
|
57833
|
+
textAlign: "center",
|
|
57834
|
+
textBaseline: "middle",
|
|
57835
|
+
backgroundFill: new Fill$1({
|
|
57836
|
+
color: "rgba(255, 255, 255, 0.9)"
|
|
57837
|
+
}),
|
|
57838
|
+
padding: [1, 3, 1, 3]
|
|
57839
|
+
}),
|
|
57840
|
+
zIndex: (this._style.zIndex || 0) + 2
|
|
57841
|
+
}));
|
|
57842
|
+
});
|
|
57843
|
+
return styles;
|
|
57844
|
+
}
|
|
57845
|
+
/**
|
|
57846
|
+
* 创建文字样式
|
|
57847
|
+
*/
|
|
57848
|
+
createTextStyle() {
|
|
57849
|
+
const center = this.getMultiPointCenter();
|
|
57850
|
+
return new Style$1({
|
|
57851
|
+
geometry: new Point$1(center),
|
|
57852
|
+
text: new Text$1({
|
|
57853
|
+
text: this._style.textContent || "",
|
|
57854
|
+
font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
|
|
57855
|
+
fill: new Fill$1({
|
|
57856
|
+
color: this._style.textColor || "#333333"
|
|
57857
|
+
}),
|
|
57858
|
+
stroke: new Stroke$1({
|
|
57859
|
+
color: "#ffffff",
|
|
57860
|
+
width: 2
|
|
57861
|
+
}),
|
|
57862
|
+
textAlign: this._style.textAlign || "center",
|
|
57863
|
+
textBaseline: this._style.textBaseline || "middle",
|
|
57864
|
+
offsetX: this._style.textOffsetX || 0,
|
|
57865
|
+
offsetY: this._style.textOffsetY || 0
|
|
57866
|
+
}),
|
|
57867
|
+
zIndex: (this._style.zIndex || 0) + 3
|
|
57868
|
+
});
|
|
57869
|
+
}
|
|
57870
|
+
/**
|
|
57871
|
+
* 更新要素几何
|
|
57872
|
+
*/
|
|
57873
|
+
updateFeatureGeometry() {
|
|
57874
|
+
if (!this.feature)
|
|
57875
|
+
return;
|
|
57876
|
+
const geometry = this.createMultiPointGeometry();
|
|
57877
|
+
this.feature.setGeometry(geometry);
|
|
57878
|
+
}
|
|
57879
|
+
/**
|
|
57880
|
+
* 创建选择样式
|
|
57881
|
+
*/
|
|
57882
|
+
createSelectionStyles() {
|
|
57883
|
+
const selectionColor = this._style.selectionColor || "#ff6b6b";
|
|
57884
|
+
const selectionOpacity = this._style.selectionOpacity || 0.8;
|
|
57885
|
+
const coordinates2 = this._config.coordinates;
|
|
57886
|
+
const styles = [];
|
|
57887
|
+
coordinates2.forEach((coord) => {
|
|
57888
|
+
styles.push(new Style$1({
|
|
57889
|
+
geometry: new Point$1(coord),
|
|
57890
|
+
image: new CircleStyle$1({
|
|
57891
|
+
radius: (this._style.size || 8) + 4,
|
|
57892
|
+
stroke: new Stroke$1({
|
|
57893
|
+
color: this.addOpacityToColor(selectionColor, selectionOpacity),
|
|
57894
|
+
width: this._style.selectionWidth || 3,
|
|
57895
|
+
lineDash: [5, 5]
|
|
57896
|
+
})
|
|
57897
|
+
}),
|
|
57898
|
+
zIndex: (this._style.zIndex || 0) + 10
|
|
57899
|
+
}));
|
|
57900
|
+
if (this._style.showEditHandles) {
|
|
57901
|
+
styles.push(new Style$1({
|
|
57902
|
+
geometry: new Point$1(coord),
|
|
57903
|
+
image: new CircleStyle$1({
|
|
57904
|
+
radius: this._style.editHandleSize || 6,
|
|
57905
|
+
fill: new Fill$1({
|
|
57906
|
+
color: this._style.editHandleColor || "#ff6b6b"
|
|
57907
|
+
}),
|
|
57908
|
+
stroke: new Stroke$1({
|
|
57909
|
+
color: "#ffffff",
|
|
57910
|
+
width: 2
|
|
57911
|
+
})
|
|
57912
|
+
}),
|
|
57913
|
+
zIndex: (this._style.zIndex || 0) + 11
|
|
57914
|
+
}));
|
|
57915
|
+
}
|
|
57916
|
+
});
|
|
57917
|
+
return styles;
|
|
57918
|
+
}
|
|
57919
|
+
/**
|
|
57920
|
+
* 获取多点中心
|
|
57921
|
+
*/
|
|
57922
|
+
getMultiPointCenter() {
|
|
57923
|
+
const coordinates2 = this._config.coordinates;
|
|
57924
|
+
if (coordinates2.length === 0)
|
|
57925
|
+
return [0, 0];
|
|
57926
|
+
const sumX = coordinates2.reduce((sum, coord) => sum + coord[0], 0);
|
|
57927
|
+
const sumY = coordinates2.reduce((sum, coord) => sum + coord[1], 0);
|
|
57928
|
+
return [sumX / coordinates2.length, sumY / coordinates2.length];
|
|
57929
|
+
}
|
|
57930
|
+
/**
|
|
57931
|
+
* 格式化坐标显示
|
|
57932
|
+
*/
|
|
57933
|
+
formatCoordinate(coordinate) {
|
|
57934
|
+
const format = this._style.coordinateFormat || "decimal";
|
|
57935
|
+
const precision = this._style.coordinatePrecision || 6;
|
|
57936
|
+
switch (format) {
|
|
57937
|
+
case "dms":
|
|
57938
|
+
return this.toDMS(coordinate);
|
|
57939
|
+
case "utm":
|
|
57940
|
+
return this.toUTM(coordinate);
|
|
57941
|
+
default:
|
|
57942
|
+
return `${coordinate[0].toFixed(precision)}, ${coordinate[1].toFixed(precision)}`;
|
|
57943
|
+
}
|
|
57944
|
+
}
|
|
57945
|
+
/**
|
|
57946
|
+
* 转换为度分秒格式
|
|
57947
|
+
*/
|
|
57948
|
+
toDMS(coordinate) {
|
|
57949
|
+
const [lon, lat] = coordinate;
|
|
57950
|
+
const latDMS = this.decimalToDMS(lat, true);
|
|
57951
|
+
const lonDMS = this.decimalToDMS(lon, false);
|
|
57952
|
+
return `${latDMS}, ${lonDMS}`;
|
|
57953
|
+
}
|
|
57954
|
+
/**
|
|
57955
|
+
* 十进制度转度分秒
|
|
57956
|
+
*/
|
|
57957
|
+
decimalToDMS(decimal, isLatitude) {
|
|
57958
|
+
const abs = Math.abs(decimal);
|
|
57959
|
+
const degrees = Math.floor(abs);
|
|
57960
|
+
const minutes = Math.floor((abs - degrees) * 60);
|
|
57961
|
+
const seconds = ((abs - degrees) * 60 - minutes) * 60;
|
|
57962
|
+
const direction2 = decimal >= 0 ? isLatitude ? "N" : "E" : isLatitude ? "S" : "W";
|
|
57963
|
+
return `${degrees}°${minutes}'${seconds.toFixed(2)}"${direction2}`;
|
|
57964
|
+
}
|
|
57965
|
+
/**
|
|
57966
|
+
* 转换为UTM格式(简化版)
|
|
57967
|
+
*/
|
|
57968
|
+
toUTM(coordinate) {
|
|
57969
|
+
return `UTM: ${coordinate[0].toFixed(0)}, ${coordinate[1].toFixed(0)}`;
|
|
57970
|
+
}
|
|
57971
|
+
/**
|
|
57972
|
+
* 设置坐标
|
|
57973
|
+
*/
|
|
57974
|
+
setCoordinates(coordinates2) {
|
|
57975
|
+
this._config.coordinates = coordinates2;
|
|
57976
|
+
this.updateFeatureGeometry();
|
|
57977
|
+
this.updateStyle();
|
|
57978
|
+
}
|
|
57979
|
+
/**
|
|
57980
|
+
* 获取坐标
|
|
57981
|
+
*/
|
|
57982
|
+
getCoordinates() {
|
|
57983
|
+
return this._config.coordinates;
|
|
57984
|
+
}
|
|
57985
|
+
/**
|
|
57986
|
+
* 获取点数量
|
|
57987
|
+
*/
|
|
57988
|
+
getPointCount() {
|
|
57989
|
+
return this._config.coordinates.length;
|
|
57990
|
+
}
|
|
57991
|
+
/**
|
|
57992
|
+
* 添加点
|
|
57993
|
+
*/
|
|
57994
|
+
addPoint(coordinate) {
|
|
57995
|
+
this._config.coordinates.push(coordinate);
|
|
57996
|
+
this.updateFeatureGeometry();
|
|
57997
|
+
this.updateStyle();
|
|
57998
|
+
}
|
|
57999
|
+
/**
|
|
58000
|
+
* 移除点
|
|
58001
|
+
*/
|
|
58002
|
+
removePoint(index2) {
|
|
58003
|
+
if (index2 >= 0 && index2 < this._config.coordinates.length) {
|
|
58004
|
+
this._config.coordinates.splice(index2, 1);
|
|
58005
|
+
this.updateFeatureGeometry();
|
|
58006
|
+
this.updateStyle();
|
|
58007
|
+
return true;
|
|
58008
|
+
}
|
|
58009
|
+
return false;
|
|
58010
|
+
}
|
|
58011
|
+
/**
|
|
58012
|
+
* 更新点坐标
|
|
58013
|
+
*/
|
|
58014
|
+
updatePoint(index2, coordinate) {
|
|
58015
|
+
if (index2 >= 0 && index2 < this._config.coordinates.length) {
|
|
58016
|
+
this._config.coordinates[index2] = coordinate;
|
|
58017
|
+
this.updateFeatureGeometry();
|
|
58018
|
+
this.updateStyle();
|
|
58019
|
+
return true;
|
|
58020
|
+
}
|
|
58021
|
+
return false;
|
|
58022
|
+
}
|
|
58023
|
+
/**
|
|
58024
|
+
* 获取边界框
|
|
58025
|
+
*/
|
|
58026
|
+
getBounds() {
|
|
58027
|
+
const coordinates2 = this._config.coordinates;
|
|
58028
|
+
if (coordinates2.length === 0)
|
|
58029
|
+
return null;
|
|
58030
|
+
let minX = coordinates2[0][0];
|
|
58031
|
+
let minY = coordinates2[0][1];
|
|
58032
|
+
let maxX = coordinates2[0][0];
|
|
58033
|
+
let maxY = coordinates2[0][1];
|
|
58034
|
+
coordinates2.forEach((coord) => {
|
|
58035
|
+
minX = Math.min(minX, coord[0]);
|
|
58036
|
+
minY = Math.min(minY, coord[1]);
|
|
58037
|
+
maxX = Math.max(maxX, coord[0]);
|
|
58038
|
+
maxY = Math.max(maxY, coord[1]);
|
|
58039
|
+
});
|
|
58040
|
+
return [minX, minY, maxX, maxY];
|
|
58041
|
+
}
|
|
58042
|
+
/**
|
|
58043
|
+
* 计算总距离(连接线长度)
|
|
58044
|
+
*/
|
|
58045
|
+
getTotalDistance(unit = "m") {
|
|
58046
|
+
const coordinates2 = this._config.coordinates;
|
|
58047
|
+
if (coordinates2.length < 2)
|
|
58048
|
+
return 0;
|
|
58049
|
+
let totalDistance = 0;
|
|
58050
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
58051
|
+
const dx = coordinates2[i + 1][0] - coordinates2[i][0];
|
|
58052
|
+
const dy = coordinates2[i + 1][1] - coordinates2[i][1];
|
|
58053
|
+
totalDistance += Math.sqrt(dx * dx + dy * dy);
|
|
58054
|
+
}
|
|
58055
|
+
switch (unit) {
|
|
58056
|
+
case "km":
|
|
58057
|
+
return totalDistance / 1e3;
|
|
58058
|
+
case "mi":
|
|
58059
|
+
return totalDistance / 1609.34;
|
|
58060
|
+
case "ft":
|
|
58061
|
+
return totalDistance * 3.28084;
|
|
58062
|
+
default:
|
|
58063
|
+
return totalDistance;
|
|
58064
|
+
}
|
|
58065
|
+
}
|
|
58066
|
+
/**
|
|
58067
|
+
* 设置点样式
|
|
58068
|
+
*/
|
|
58069
|
+
setPointStyle(options) {
|
|
58070
|
+
if (options.style)
|
|
58071
|
+
this._style.pointStyle = options.style;
|
|
58072
|
+
if (options.color)
|
|
58073
|
+
this._style.color = options.color;
|
|
58074
|
+
if (options.size !== void 0)
|
|
58075
|
+
this._style.size = options.size;
|
|
58076
|
+
if (options.opacity !== void 0)
|
|
58077
|
+
this._style.opacity = options.opacity;
|
|
58078
|
+
this.updateStyle();
|
|
58079
|
+
}
|
|
58080
|
+
/**
|
|
58081
|
+
* 设置连接线显示
|
|
58082
|
+
*/
|
|
58083
|
+
setConnectingLinesVisible(visible, options) {
|
|
58084
|
+
this._style.showConnectingLines = visible;
|
|
58085
|
+
if (options == null ? void 0 : options.color)
|
|
58086
|
+
this._style.connectingLineColor = options.color;
|
|
58087
|
+
if ((options == null ? void 0 : options.width) !== void 0)
|
|
58088
|
+
this._style.connectingLineWidth = options.width;
|
|
58089
|
+
if (options == null ? void 0 : options.dash)
|
|
58090
|
+
this._style.connectingLineDash = options.dash;
|
|
58091
|
+
if ((options == null ? void 0 : options.opacity) !== void 0)
|
|
58092
|
+
this._style.connectingLineOpacity = options.opacity;
|
|
58093
|
+
this.updateStyle();
|
|
58094
|
+
}
|
|
58095
|
+
/**
|
|
58096
|
+
* 设置点索引显示
|
|
58097
|
+
*/
|
|
58098
|
+
setPointIndexVisible(visible, options) {
|
|
58099
|
+
this._style.showPointIndex = visible;
|
|
58100
|
+
if (options == null ? void 0 : options.fontSize)
|
|
58101
|
+
this._style.indexFontSize = options.fontSize;
|
|
58102
|
+
if (options == null ? void 0 : options.color)
|
|
58103
|
+
this._style.indexColor = options.color;
|
|
58104
|
+
if (options == null ? void 0 : options.offset)
|
|
58105
|
+
this._style.indexOffset = options.offset;
|
|
58106
|
+
this.updateStyle();
|
|
58107
|
+
}
|
|
58108
|
+
/**
|
|
58109
|
+
* 设置坐标显示
|
|
58110
|
+
*/
|
|
58111
|
+
setCoordinatesVisible(visible, options) {
|
|
58112
|
+
this._style.showCoordinates = visible;
|
|
58113
|
+
if (options == null ? void 0 : options.format)
|
|
58114
|
+
this._style.coordinateFormat = options.format;
|
|
58115
|
+
if ((options == null ? void 0 : options.precision) !== void 0)
|
|
58116
|
+
this._style.coordinatePrecision = options.precision;
|
|
58117
|
+
this.updateStyle();
|
|
58118
|
+
}
|
|
58119
|
+
/**
|
|
58120
|
+
* 创建实例
|
|
58121
|
+
*/
|
|
58122
|
+
createInstance(config) {
|
|
58123
|
+
return new MultiPointDrawing(config);
|
|
58124
|
+
}
|
|
58125
|
+
/**
|
|
58126
|
+
* 从JSON反序列化
|
|
58127
|
+
*/
|
|
58128
|
+
static fromJSON(data) {
|
|
58129
|
+
const config = {
|
|
58130
|
+
id: data.id,
|
|
58131
|
+
type: "multipoint",
|
|
58132
|
+
name: data.name,
|
|
58133
|
+
coordinates: data.coordinates,
|
|
58134
|
+
properties: data.properties || {},
|
|
58135
|
+
style: data.style || {},
|
|
58136
|
+
visible: data.visible !== false
|
|
58137
|
+
};
|
|
58138
|
+
return new MultiPointDrawing(config);
|
|
58139
|
+
}
|
|
58140
|
+
/**
|
|
58141
|
+
* 从GeoJSON创建MultiPointDrawing
|
|
58142
|
+
*/
|
|
58143
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
58144
|
+
var _a2;
|
|
58145
|
+
if (geoJsonFeature.geometry.type !== "MultiPoint") {
|
|
58146
|
+
throw new Error("GeoJSON feature must be of type MultiPoint");
|
|
58147
|
+
}
|
|
58148
|
+
const config = {
|
|
58149
|
+
id: geoJsonFeature.id || `multipoint_${Date.now()}`,
|
|
58150
|
+
type: "multipoint",
|
|
58151
|
+
name: ((_a2 = geoJsonFeature.properties) == null ? void 0 : _a2.name) || "多点",
|
|
58152
|
+
coordinates: geoJsonFeature.geometry.coordinates,
|
|
58153
|
+
properties: geoJsonFeature.properties || {},
|
|
58154
|
+
style: {},
|
|
58155
|
+
visible: true
|
|
58156
|
+
};
|
|
58157
|
+
return new MultiPointDrawing(config);
|
|
58158
|
+
}
|
|
58159
|
+
/**
|
|
58160
|
+
* 添加透明度到颜色
|
|
58161
|
+
*/
|
|
58162
|
+
addOpacityToColor(color2, opacity2) {
|
|
58163
|
+
if (opacity2 >= 1)
|
|
58164
|
+
return color2;
|
|
58165
|
+
if (color2.startsWith("#")) {
|
|
58166
|
+
const hex = color2.slice(1);
|
|
58167
|
+
const r = parseInt(hex.substr(0, 2), 16);
|
|
58168
|
+
const g2 = parseInt(hex.substr(2, 2), 16);
|
|
58169
|
+
const b2 = parseInt(hex.substr(4, 2), 16);
|
|
58170
|
+
return `rgba(${r}, ${g2}, ${b2}, ${opacity2})`;
|
|
58171
|
+
}
|
|
58172
|
+
if (color2.startsWith("rgba")) {
|
|
58173
|
+
return color2.replace(/[\d\.]+\)$/g, `${opacity2})`);
|
|
58174
|
+
}
|
|
58175
|
+
if (color2.startsWith("rgb")) {
|
|
58176
|
+
return color2.replace("rgb", "rgba").replace(")", `, ${opacity2})`);
|
|
58177
|
+
}
|
|
58178
|
+
return color2;
|
|
58179
|
+
}
|
|
58180
|
+
}
|
|
58181
|
+
class MultiPointDrawingFactory {
|
|
58182
|
+
static create(config) {
|
|
58183
|
+
return new MultiPointDrawing(config);
|
|
58184
|
+
}
|
|
58185
|
+
static getType() {
|
|
58186
|
+
return "multipoint";
|
|
58187
|
+
}
|
|
58188
|
+
static getSupportedTypes() {
|
|
58189
|
+
return ["multipoint", "multi-point"];
|
|
58190
|
+
}
|
|
58191
|
+
/**
|
|
58192
|
+
* 从GeoJSON创建
|
|
58193
|
+
*/
|
|
58194
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
58195
|
+
return MultiPointDrawing.fromGeoJSON(geoJsonFeature);
|
|
58196
|
+
}
|
|
58197
|
+
/**
|
|
58198
|
+
* 创建预设样式的多点
|
|
58199
|
+
*/
|
|
58200
|
+
static createPreset(coordinates2, preset, options) {
|
|
58201
|
+
const presetStyles = {
|
|
58202
|
+
default: { color: "#409eff" },
|
|
58203
|
+
highlight: { color: "#e6a23c" },
|
|
58204
|
+
warning: { color: "#f56c6c" },
|
|
58205
|
+
success: { color: "#67c23a" },
|
|
58206
|
+
danger: { color: "#f56c6c" }
|
|
58207
|
+
};
|
|
58208
|
+
const style = presetStyles[preset];
|
|
58209
|
+
const config = {
|
|
58210
|
+
type: "multipoint",
|
|
58211
|
+
coordinates: coordinates2,
|
|
58212
|
+
name: (options == null ? void 0 : options.name) || "多点",
|
|
58213
|
+
style: {
|
|
58214
|
+
...style,
|
|
58215
|
+
pointStyle: (options == null ? void 0 : options.pointStyle) || "circle",
|
|
58216
|
+
size: 8,
|
|
58217
|
+
opacity: 1,
|
|
58218
|
+
strokeWidth: 2,
|
|
58219
|
+
textContent: options == null ? void 0 : options.text,
|
|
58220
|
+
showPointIndex: (options == null ? void 0 : options.showIndex) || false,
|
|
58221
|
+
showConnectingLines: (options == null ? void 0 : options.showConnectingLines) || false,
|
|
58222
|
+
showCoordinates: (options == null ? void 0 : options.showCoordinates) || false
|
|
58223
|
+
}
|
|
58224
|
+
};
|
|
58225
|
+
return new MultiPointDrawing(config);
|
|
58226
|
+
}
|
|
58227
|
+
}
|
|
58228
|
+
class MultiLineStringDrawing extends BaseDrawing {
|
|
58229
|
+
constructor(config) {
|
|
58230
|
+
super(config);
|
|
58231
|
+
__publicField(this, "_config");
|
|
58232
|
+
__publicField(this, "_style");
|
|
58233
|
+
__publicField(this, "_animationFrame");
|
|
58234
|
+
__publicField(this, "_animationStartTime");
|
|
58235
|
+
this._config = config;
|
|
58236
|
+
this._style = {
|
|
58237
|
+
strokeColor: "#409eff",
|
|
58238
|
+
strokeWidth: 2,
|
|
58239
|
+
strokeOpacity: 1,
|
|
58240
|
+
strokeLineCap: "round",
|
|
58241
|
+
strokeLineJoin: "round",
|
|
58242
|
+
strokeMiterLimit: 10,
|
|
58243
|
+
showArrows: false,
|
|
58244
|
+
arrowSize: 8,
|
|
58245
|
+
arrowColor: "#409eff",
|
|
58246
|
+
arrowSpacing: 50,
|
|
58247
|
+
arrowStyle: "triangle",
|
|
58248
|
+
showStartPoint: false,
|
|
58249
|
+
showEndPoint: false,
|
|
58250
|
+
startPointStyle: "circle",
|
|
58251
|
+
endPointStyle: "circle",
|
|
58252
|
+
pointSize: 6,
|
|
58253
|
+
pointColor: "#409eff",
|
|
58254
|
+
showVertices: false,
|
|
58255
|
+
vertexSize: 4,
|
|
58256
|
+
vertexColor: "#409eff",
|
|
58257
|
+
vertexStyle: "circle",
|
|
58258
|
+
showLineIndex: false,
|
|
58259
|
+
indexFontSize: 12,
|
|
58260
|
+
indexColor: "#333333",
|
|
58261
|
+
indexOffset: [0, -10],
|
|
58262
|
+
showLength: false,
|
|
58263
|
+
lengthUnit: "m",
|
|
58264
|
+
lengthPrecision: 2,
|
|
58265
|
+
lengthPosition: "middle",
|
|
58266
|
+
enableGradient: false,
|
|
58267
|
+
gradientColors: ["#409eff", "#67c23a"],
|
|
58268
|
+
gradientDirection: "horizontal",
|
|
58269
|
+
enableAnimation: false,
|
|
58270
|
+
animationType: "flow",
|
|
58271
|
+
animationSpeed: 1e3,
|
|
58272
|
+
animationDirection: "forward",
|
|
58273
|
+
groupColors: [],
|
|
58274
|
+
groupWidths: [],
|
|
58275
|
+
groupDashes: [],
|
|
58276
|
+
...config.style
|
|
58277
|
+
};
|
|
58278
|
+
}
|
|
58279
|
+
/**
|
|
58280
|
+
* 创建要素
|
|
58281
|
+
*/
|
|
58282
|
+
createFeature() {
|
|
58283
|
+
const geometry = this.createMultiLineStringGeometry();
|
|
58284
|
+
this.feature = new Feature$2({
|
|
58285
|
+
geometry,
|
|
58286
|
+
id: this.getId(),
|
|
58287
|
+
type: this.getType(),
|
|
58288
|
+
name: this.getName(),
|
|
58289
|
+
properties: this.getProperties()
|
|
58290
|
+
});
|
|
58291
|
+
}
|
|
58292
|
+
/**
|
|
58293
|
+
* 创建多线段几何
|
|
58294
|
+
*/
|
|
58295
|
+
createMultiLineStringGeometry() {
|
|
58296
|
+
const coordinates2 = this._config.coordinates;
|
|
58297
|
+
if (!coordinates2 || coordinates2.length === 0) {
|
|
58298
|
+
throw new Error("MultiLineString coordinates cannot be empty");
|
|
58299
|
+
}
|
|
58300
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58301
|
+
if (lineCoords.length < 2) {
|
|
58302
|
+
throw new Error(`Line ${index2} must have at least 2 points`);
|
|
58303
|
+
}
|
|
58304
|
+
});
|
|
58305
|
+
return new MultiLineString$1(coordinates2);
|
|
58306
|
+
}
|
|
58307
|
+
/**
|
|
58308
|
+
* 创建样式
|
|
58309
|
+
*/
|
|
58310
|
+
createStyle() {
|
|
58311
|
+
const styles = [];
|
|
58312
|
+
styles.push(...this.createLineStyles());
|
|
58313
|
+
if (this._style.showArrows) {
|
|
58314
|
+
styles.push(...this.createArrowStyles());
|
|
58315
|
+
}
|
|
58316
|
+
if (this._style.showStartPoint || this._style.showEndPoint) {
|
|
58317
|
+
styles.push(...this.createEndPointStyles());
|
|
58318
|
+
}
|
|
58319
|
+
if (this._style.showVertices) {
|
|
58320
|
+
styles.push(...this.createVertexStyles());
|
|
58321
|
+
}
|
|
58322
|
+
if (this._style.showLineIndex) {
|
|
58323
|
+
styles.push(...this.createIndexStyles());
|
|
58324
|
+
}
|
|
58325
|
+
if (this._style.showLength) {
|
|
58326
|
+
styles.push(...this.createLengthStyles());
|
|
58327
|
+
}
|
|
58328
|
+
if (this._style.textContent) {
|
|
58329
|
+
styles.push(this.createTextStyle());
|
|
58330
|
+
}
|
|
58331
|
+
return styles.length === 1 ? styles[0] : styles;
|
|
58332
|
+
}
|
|
58333
|
+
/**
|
|
58334
|
+
* 创建线条样式
|
|
58335
|
+
*/
|
|
58336
|
+
createLineStyles() {
|
|
58337
|
+
const styles = [];
|
|
58338
|
+
const coordinates2 = this._config.coordinates;
|
|
58339
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58340
|
+
const lineGeometry = new LineString$1(lineCoords);
|
|
58341
|
+
const strokeColor = this.getLineColor(index2);
|
|
58342
|
+
const strokeWidth = this.getLineWidth(index2);
|
|
58343
|
+
const strokeDash = this.getLineDash(index2);
|
|
58344
|
+
const style = new Style$1({
|
|
58345
|
+
geometry: lineGeometry,
|
|
58346
|
+
stroke: new Stroke$1({
|
|
58347
|
+
color: this.addOpacityToColor(strokeColor, this._style.strokeOpacity || 1),
|
|
58348
|
+
width: strokeWidth,
|
|
58349
|
+
lineDash: strokeDash,
|
|
58350
|
+
lineCap: this._style.strokeLineCap || "round",
|
|
58351
|
+
lineJoin: this._style.strokeLineJoin || "round",
|
|
58352
|
+
miterLimit: this._style.strokeMiterLimit || 10
|
|
58353
|
+
}),
|
|
58354
|
+
zIndex: (this._style.zIndex || 0) + index2
|
|
58355
|
+
});
|
|
58356
|
+
styles.push(style);
|
|
58357
|
+
if (this._style.enableGradient) {
|
|
58358
|
+
styles.push(...this.createGradientStyles(lineGeometry, index2));
|
|
58359
|
+
}
|
|
58360
|
+
});
|
|
58361
|
+
return styles;
|
|
58362
|
+
}
|
|
58363
|
+
/**
|
|
58364
|
+
* 创建渐变样式
|
|
58365
|
+
*/
|
|
58366
|
+
createGradientStyles(lineGeometry, index2) {
|
|
58367
|
+
const styles = [];
|
|
58368
|
+
const gradientColors = this._style.gradientColors || ["#409eff", "#67c23a"];
|
|
58369
|
+
const segments = Math.min(gradientColors.length - 1, 10);
|
|
58370
|
+
const coordinates2 = lineGeometry.getCoordinates();
|
|
58371
|
+
this.calculateLineLength(coordinates2);
|
|
58372
|
+
for (let i = 0; i < segments; i++) {
|
|
58373
|
+
const startRatio = i / segments;
|
|
58374
|
+
const endRatio = (i + 1) / segments;
|
|
58375
|
+
const startIndex = Math.floor(startRatio * (coordinates2.length - 1));
|
|
58376
|
+
const endIndex = Math.ceil(endRatio * (coordinates2.length - 1));
|
|
58377
|
+
const segmentCoords = coordinates2.slice(startIndex, endIndex + 1);
|
|
58378
|
+
if (segmentCoords.length < 2)
|
|
58379
|
+
continue;
|
|
58380
|
+
const segmentGeometry = new LineString$1(segmentCoords);
|
|
58381
|
+
const color2 = this.interpolateColor(gradientColors[i], gradientColors[i + 1] || gradientColors[i], 0.5);
|
|
58382
|
+
styles.push(new Style$1({
|
|
58383
|
+
geometry: segmentGeometry,
|
|
58384
|
+
stroke: new Stroke$1({
|
|
58385
|
+
color: this.addOpacityToColor(color2, this._style.strokeOpacity || 1),
|
|
58386
|
+
width: this.getLineWidth(index2),
|
|
58387
|
+
lineCap: this._style.strokeLineCap || "round",
|
|
58388
|
+
lineJoin: this._style.strokeLineJoin || "round"
|
|
58389
|
+
}),
|
|
58390
|
+
zIndex: (this._style.zIndex || 0) + index2 + 0.1
|
|
58391
|
+
}));
|
|
58392
|
+
}
|
|
58393
|
+
return styles;
|
|
58394
|
+
}
|
|
58395
|
+
/**
|
|
58396
|
+
* 创建箭头样式
|
|
58397
|
+
*/
|
|
58398
|
+
createArrowStyles() {
|
|
58399
|
+
const styles = [];
|
|
58400
|
+
const coordinates2 = this._config.coordinates;
|
|
58401
|
+
const arrowSize = this._style.arrowSize || 8;
|
|
58402
|
+
const arrowSpacing = this._style.arrowSpacing || 50;
|
|
58403
|
+
const arrowColor = this._style.arrowColor || this._style.strokeColor || "#409eff";
|
|
58404
|
+
coordinates2.forEach((lineCoords, lineIndex) => {
|
|
58405
|
+
if (lineCoords.length < 2)
|
|
58406
|
+
return;
|
|
58407
|
+
const lineLength = this.calculateLineLength(lineCoords);
|
|
58408
|
+
const arrowCount = Math.floor(lineLength / arrowSpacing);
|
|
58409
|
+
for (let i = 1; i <= arrowCount; i++) {
|
|
58410
|
+
const ratio = i / (arrowCount + 1);
|
|
58411
|
+
const arrowPosition = this.getPointAtRatio(lineCoords, ratio);
|
|
58412
|
+
const arrowAngle = this.getAngleAtRatio(lineCoords, ratio);
|
|
58413
|
+
if (arrowPosition) {
|
|
58414
|
+
styles.push(this.createArrowStyle(arrowPosition, arrowAngle, arrowSize, arrowColor, lineIndex));
|
|
58415
|
+
}
|
|
58416
|
+
}
|
|
58417
|
+
});
|
|
58418
|
+
return styles;
|
|
58419
|
+
}
|
|
58420
|
+
/**
|
|
58421
|
+
* 创建单个箭头样式
|
|
58422
|
+
*/
|
|
58423
|
+
createArrowStyle(position2, angle2, size, color2, zIndex2) {
|
|
58424
|
+
const arrowGeometry = new Point$1(position2);
|
|
58425
|
+
switch (this._style.arrowStyle) {
|
|
58426
|
+
case "triangle":
|
|
58427
|
+
return new Style$1({
|
|
58428
|
+
geometry: arrowGeometry,
|
|
58429
|
+
image: new ol.style.RegularShape({
|
|
58430
|
+
points: 3,
|
|
58431
|
+
radius: size,
|
|
58432
|
+
angle: angle2,
|
|
58433
|
+
fill: new Fill$1({ color: color2 }),
|
|
58434
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58435
|
+
}),
|
|
58436
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 1
|
|
58437
|
+
});
|
|
58438
|
+
case "circle":
|
|
58439
|
+
return new Style$1({
|
|
58440
|
+
geometry: arrowGeometry,
|
|
58441
|
+
image: new CircleStyle$1({
|
|
58442
|
+
radius: size / 2,
|
|
58443
|
+
fill: new Fill$1({ color: color2 }),
|
|
58444
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58445
|
+
}),
|
|
58446
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 1
|
|
58447
|
+
});
|
|
58448
|
+
case "square":
|
|
58449
|
+
return new Style$1({
|
|
58450
|
+
geometry: arrowGeometry,
|
|
58451
|
+
image: new ol.style.RegularShape({
|
|
58452
|
+
points: 4,
|
|
58453
|
+
radius: size,
|
|
58454
|
+
angle: angle2 + Math.PI / 4,
|
|
58455
|
+
fill: new Fill$1({ color: color2 }),
|
|
58456
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58457
|
+
}),
|
|
58458
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 1
|
|
58459
|
+
});
|
|
58460
|
+
default:
|
|
58461
|
+
return new Style$1({
|
|
58462
|
+
geometry: arrowGeometry,
|
|
58463
|
+
image: new ol.style.RegularShape({
|
|
58464
|
+
points: 3,
|
|
58465
|
+
radius: size,
|
|
58466
|
+
angle: angle2,
|
|
58467
|
+
fill: new Fill$1({ color: color2 }),
|
|
58468
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58469
|
+
}),
|
|
58470
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 1
|
|
58471
|
+
});
|
|
58472
|
+
}
|
|
58473
|
+
}
|
|
58474
|
+
/**
|
|
58475
|
+
* 创建端点样式
|
|
58476
|
+
*/
|
|
58477
|
+
createEndPointStyles() {
|
|
58478
|
+
const styles = [];
|
|
58479
|
+
const coordinates2 = this._config.coordinates;
|
|
58480
|
+
const pointSize = this._style.pointSize || 6;
|
|
58481
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58482
|
+
if (lineCoords.length < 2)
|
|
58483
|
+
return;
|
|
58484
|
+
if (this._style.showStartPoint) {
|
|
58485
|
+
const startPoint = lineCoords[0];
|
|
58486
|
+
const startColor = this._style.startPointColor || this._style.pointColor || "#409eff";
|
|
58487
|
+
styles.push(this.createPointStyle(startPoint, this._style.startPointStyle || "circle", pointSize, startColor, index2));
|
|
58488
|
+
}
|
|
58489
|
+
if (this._style.showEndPoint) {
|
|
58490
|
+
const endPoint = lineCoords[lineCoords.length - 1];
|
|
58491
|
+
const endColor = this._style.endPointColor || this._style.pointColor || "#409eff";
|
|
58492
|
+
styles.push(this.createPointStyle(endPoint, this._style.endPointStyle || "circle", pointSize, endColor, index2));
|
|
58493
|
+
}
|
|
58494
|
+
});
|
|
58495
|
+
return styles;
|
|
58496
|
+
}
|
|
58497
|
+
/**
|
|
58498
|
+
* 创建点样式
|
|
58499
|
+
*/
|
|
58500
|
+
createPointStyle(coordinate, style, size, color2, zIndex2) {
|
|
58501
|
+
const pointGeometry = new Point$1(coordinate);
|
|
58502
|
+
switch (style) {
|
|
58503
|
+
case "square":
|
|
58504
|
+
return new Style$1({
|
|
58505
|
+
geometry: pointGeometry,
|
|
58506
|
+
image: new ol.style.RegularShape({
|
|
58507
|
+
points: 4,
|
|
58508
|
+
radius: size,
|
|
58509
|
+
angle: Math.PI / 4,
|
|
58510
|
+
fill: new Fill$1({ color: color2 }),
|
|
58511
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 2 })
|
|
58512
|
+
}),
|
|
58513
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 2
|
|
58514
|
+
});
|
|
58515
|
+
case "triangle":
|
|
58516
|
+
return new Style$1({
|
|
58517
|
+
geometry: pointGeometry,
|
|
58518
|
+
image: new ol.style.RegularShape({
|
|
58519
|
+
points: 3,
|
|
58520
|
+
radius: size,
|
|
58521
|
+
fill: new Fill$1({ color: color2 }),
|
|
58522
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 2 })
|
|
58523
|
+
}),
|
|
58524
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 2
|
|
58525
|
+
});
|
|
58526
|
+
case "star":
|
|
58527
|
+
return new Style$1({
|
|
58528
|
+
geometry: pointGeometry,
|
|
58529
|
+
image: new ol.style.RegularShape({
|
|
58530
|
+
points: 5,
|
|
58531
|
+
radius: size,
|
|
58532
|
+
radius2: size / 2,
|
|
58533
|
+
fill: new Fill$1({ color: color2 }),
|
|
58534
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 2 })
|
|
58535
|
+
}),
|
|
58536
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 2
|
|
58537
|
+
});
|
|
58538
|
+
default:
|
|
58539
|
+
return new Style$1({
|
|
58540
|
+
geometry: pointGeometry,
|
|
58541
|
+
image: new CircleStyle$1({
|
|
58542
|
+
radius: size,
|
|
58543
|
+
fill: new Fill$1({ color: color2 }),
|
|
58544
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 2 })
|
|
58545
|
+
}),
|
|
58546
|
+
zIndex: (this._style.zIndex || 0) + zIndex2 + 2
|
|
58547
|
+
});
|
|
58548
|
+
}
|
|
58549
|
+
}
|
|
58550
|
+
/**
|
|
58551
|
+
* 创建顶点样式
|
|
58552
|
+
*/
|
|
58553
|
+
createVertexStyles() {
|
|
58554
|
+
const styles = [];
|
|
58555
|
+
const coordinates2 = this._config.coordinates;
|
|
58556
|
+
const vertexSize = this._style.vertexSize || 4;
|
|
58557
|
+
const vertexColor = this._style.vertexColor || "#409eff";
|
|
58558
|
+
coordinates2.forEach((lineCoords, lineIndex) => {
|
|
58559
|
+
lineCoords.forEach((coord) => {
|
|
58560
|
+
const pointGeometry = new Point$1(coord);
|
|
58561
|
+
const style = this._style.vertexStyle === "square" ? new Style$1({
|
|
58562
|
+
geometry: pointGeometry,
|
|
58563
|
+
image: new ol.style.RegularShape({
|
|
58564
|
+
points: 4,
|
|
58565
|
+
radius: vertexSize,
|
|
58566
|
+
angle: Math.PI / 4,
|
|
58567
|
+
fill: new Fill$1({ color: vertexColor }),
|
|
58568
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58569
|
+
}),
|
|
58570
|
+
zIndex: (this._style.zIndex || 0) + lineIndex + 3
|
|
58571
|
+
}) : new Style$1({
|
|
58572
|
+
geometry: pointGeometry,
|
|
58573
|
+
image: new CircleStyle$1({
|
|
58574
|
+
radius: vertexSize,
|
|
58575
|
+
fill: new Fill$1({ color: vertexColor }),
|
|
58576
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 1 })
|
|
58577
|
+
}),
|
|
58578
|
+
zIndex: (this._style.zIndex || 0) + lineIndex + 3
|
|
58579
|
+
});
|
|
58580
|
+
styles.push(style);
|
|
58581
|
+
});
|
|
58582
|
+
});
|
|
58583
|
+
return styles;
|
|
58584
|
+
}
|
|
58585
|
+
/**
|
|
58586
|
+
* 创建索引标注样式
|
|
58587
|
+
*/
|
|
58588
|
+
createIndexStyles() {
|
|
58589
|
+
const styles = [];
|
|
58590
|
+
const coordinates2 = this._config.coordinates;
|
|
58591
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58592
|
+
var _a2, _b2;
|
|
58593
|
+
if (lineCoords.length < 2)
|
|
58594
|
+
return;
|
|
58595
|
+
const midPoint = this.getLineCenter(lineCoords);
|
|
58596
|
+
const offsetPoint = [
|
|
58597
|
+
midPoint[0] + (((_a2 = this._style.indexOffset) == null ? void 0 : _a2[0]) || 0),
|
|
58598
|
+
midPoint[1] + (((_b2 = this._style.indexOffset) == null ? void 0 : _b2[1]) || -10)
|
|
58599
|
+
];
|
|
58600
|
+
styles.push(new Style$1({
|
|
58601
|
+
geometry: new Point$1(offsetPoint),
|
|
58602
|
+
text: new Text$1({
|
|
58603
|
+
text: `${index2 + 1}`,
|
|
58604
|
+
font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
|
|
58605
|
+
fill: new Fill$1({
|
|
58606
|
+
color: this._style.indexColor || "#333333"
|
|
58607
|
+
}),
|
|
58608
|
+
stroke: new Stroke$1({
|
|
58609
|
+
color: "#ffffff",
|
|
58610
|
+
width: 2
|
|
58611
|
+
}),
|
|
58612
|
+
textAlign: "center",
|
|
58613
|
+
textBaseline: "middle",
|
|
58614
|
+
backgroundFill: new Fill$1({
|
|
58615
|
+
color: "rgba(255, 255, 255, 0.8)"
|
|
58616
|
+
}),
|
|
58617
|
+
padding: [2, 4, 2, 4]
|
|
58618
|
+
}),
|
|
58619
|
+
zIndex: (this._style.zIndex || 0) + index2 + 4
|
|
58620
|
+
}));
|
|
58621
|
+
});
|
|
58622
|
+
return styles;
|
|
58623
|
+
}
|
|
58624
|
+
/**
|
|
58625
|
+
* 创建长度标注样式
|
|
58626
|
+
*/
|
|
58627
|
+
createLengthStyles() {
|
|
58628
|
+
const styles = [];
|
|
58629
|
+
const coordinates2 = this._config.coordinates;
|
|
58630
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58631
|
+
var _a2;
|
|
58632
|
+
if (lineCoords.length < 2)
|
|
58633
|
+
return;
|
|
58634
|
+
const length = this.calculateLineLength(lineCoords);
|
|
58635
|
+
const lengthText = this.formatLength(length);
|
|
58636
|
+
let labelPosition;
|
|
58637
|
+
switch (this._style.lengthPosition) {
|
|
58638
|
+
case "start":
|
|
58639
|
+
labelPosition = lineCoords[0];
|
|
58640
|
+
break;
|
|
58641
|
+
case "end":
|
|
58642
|
+
labelPosition = lineCoords[lineCoords.length - 1];
|
|
58643
|
+
break;
|
|
58644
|
+
default:
|
|
58645
|
+
labelPosition = this.getLineCenter(lineCoords);
|
|
58646
|
+
}
|
|
58647
|
+
const offsetPosition = [
|
|
58648
|
+
labelPosition[0],
|
|
58649
|
+
labelPosition[1] + (((_a2 = this._style.indexOffset) == null ? void 0 : _a2[1]) || -10) - 15
|
|
58650
|
+
];
|
|
58651
|
+
styles.push(new Style$1({
|
|
58652
|
+
geometry: new Point$1(offsetPosition),
|
|
58653
|
+
text: new Text$1({
|
|
58654
|
+
text: lengthText,
|
|
58655
|
+
font: `${(this._style.fontSize || 12) - 1}px ${this._style.fontFamily || "Arial"}`,
|
|
58656
|
+
fill: new Fill$1({
|
|
58657
|
+
color: this._style.textColor || "#666666"
|
|
58658
|
+
}),
|
|
58659
|
+
stroke: new Stroke$1({
|
|
58660
|
+
color: "#ffffff",
|
|
58661
|
+
width: 1
|
|
58662
|
+
}),
|
|
58663
|
+
textAlign: "center",
|
|
58664
|
+
textBaseline: "middle",
|
|
58665
|
+
backgroundFill: new Fill$1({
|
|
58666
|
+
color: "rgba(255, 255, 255, 0.9)"
|
|
58667
|
+
}),
|
|
58668
|
+
padding: [1, 3, 1, 3]
|
|
58669
|
+
}),
|
|
58670
|
+
zIndex: (this._style.zIndex || 0) + index2 + 4
|
|
58671
|
+
}));
|
|
58672
|
+
});
|
|
58673
|
+
return styles;
|
|
58674
|
+
}
|
|
58675
|
+
/**
|
|
58676
|
+
* 创建文字样式
|
|
58677
|
+
*/
|
|
58678
|
+
createTextStyle() {
|
|
58679
|
+
const center = this.getMultiLineStringCenter();
|
|
58680
|
+
return new Style$1({
|
|
58681
|
+
geometry: new Point$1(center),
|
|
58682
|
+
text: new Text$1({
|
|
58683
|
+
text: this._style.textContent || "",
|
|
58684
|
+
font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
|
|
58685
|
+
fill: new Fill$1({
|
|
58686
|
+
color: this._style.textColor || "#333333"
|
|
58687
|
+
}),
|
|
58688
|
+
stroke: new Stroke$1({
|
|
58689
|
+
color: "#ffffff",
|
|
58690
|
+
width: 2
|
|
58691
|
+
}),
|
|
58692
|
+
textAlign: this._style.textAlign || "center",
|
|
58693
|
+
textBaseline: this._style.textBaseline || "middle",
|
|
58694
|
+
offsetX: this._style.textOffsetX || 0,
|
|
58695
|
+
offsetY: this._style.textOffsetY || 0
|
|
58696
|
+
}),
|
|
58697
|
+
zIndex: (this._style.zIndex || 0) + 5
|
|
58698
|
+
});
|
|
58699
|
+
}
|
|
58700
|
+
/**
|
|
58701
|
+
* 更新要素几何
|
|
58702
|
+
*/
|
|
58703
|
+
updateFeatureGeometry() {
|
|
58704
|
+
if (!this.feature)
|
|
58705
|
+
return;
|
|
58706
|
+
const geometry = this.createMultiLineStringGeometry();
|
|
58707
|
+
this.feature.setGeometry(geometry);
|
|
58708
|
+
}
|
|
58709
|
+
/**
|
|
58710
|
+
* 创建选择样式
|
|
58711
|
+
*/
|
|
58712
|
+
createSelectionStyles() {
|
|
58713
|
+
const selectionColor = this._style.selectionColor || "#ff6b6b";
|
|
58714
|
+
const selectionWidth = this._style.selectionWidth || 3;
|
|
58715
|
+
const selectionOpacity = this._style.selectionOpacity || 0.8;
|
|
58716
|
+
const coordinates2 = this._config.coordinates;
|
|
58717
|
+
const styles = [];
|
|
58718
|
+
coordinates2.forEach((lineCoords, index2) => {
|
|
58719
|
+
const lineGeometry = new LineString$1(lineCoords);
|
|
58720
|
+
styles.push(new Style$1({
|
|
58721
|
+
geometry: lineGeometry,
|
|
58722
|
+
stroke: new Stroke$1({
|
|
58723
|
+
color: this.addOpacityToColor(selectionColor, selectionOpacity),
|
|
58724
|
+
width: selectionWidth,
|
|
58725
|
+
lineDash: [5, 5]
|
|
58726
|
+
}),
|
|
58727
|
+
zIndex: (this._style.zIndex || 0) + index2 + 10
|
|
58728
|
+
}));
|
|
58729
|
+
if (this._style.showEditHandles) {
|
|
58730
|
+
lineCoords.forEach((coord) => {
|
|
58731
|
+
styles.push(new Style$1({
|
|
58732
|
+
geometry: new Point$1(coord),
|
|
58733
|
+
image: new CircleStyle$1({
|
|
58734
|
+
radius: this._style.editHandleSize || 6,
|
|
58735
|
+
fill: new Fill$1({
|
|
58736
|
+
color: this._style.editHandleColor || "#ff6b6b"
|
|
58737
|
+
}),
|
|
58738
|
+
stroke: new Stroke$1({
|
|
58739
|
+
color: "#ffffff",
|
|
58740
|
+
width: 2
|
|
58741
|
+
})
|
|
58742
|
+
}),
|
|
58743
|
+
zIndex: (this._style.zIndex || 0) + index2 + 11
|
|
58744
|
+
}));
|
|
58745
|
+
});
|
|
58746
|
+
}
|
|
58747
|
+
});
|
|
58748
|
+
return styles;
|
|
58749
|
+
}
|
|
58750
|
+
/**
|
|
58751
|
+
* 获取线条颜色(支持分组)
|
|
58752
|
+
*/
|
|
58753
|
+
getLineColor(index2) {
|
|
58754
|
+
const groupColors = this._style.groupColors;
|
|
58755
|
+
if (groupColors && groupColors.length > 0) {
|
|
58756
|
+
return groupColors[index2 % groupColors.length];
|
|
58757
|
+
}
|
|
58758
|
+
return this._style.strokeColor || "#409eff";
|
|
58759
|
+
}
|
|
58760
|
+
/**
|
|
58761
|
+
* 获取线条宽度(支持分组)
|
|
58762
|
+
*/
|
|
58763
|
+
getLineWidth(index2) {
|
|
58764
|
+
const groupWidths = this._style.groupWidths;
|
|
58765
|
+
if (groupWidths && groupWidths.length > 0) {
|
|
58766
|
+
return groupWidths[index2 % groupWidths.length];
|
|
58767
|
+
}
|
|
58768
|
+
return this._style.strokeWidth || 2;
|
|
58769
|
+
}
|
|
58770
|
+
/**
|
|
58771
|
+
* 获取线条虚线样式(支持分组)
|
|
58772
|
+
*/
|
|
58773
|
+
getLineDash(index2) {
|
|
58774
|
+
const groupDashes = this._style.groupDashes;
|
|
58775
|
+
if (groupDashes && groupDashes.length > 0) {
|
|
58776
|
+
return groupDashes[index2 % groupDashes.length];
|
|
58777
|
+
}
|
|
58778
|
+
return this._style.strokeDash;
|
|
58779
|
+
}
|
|
58780
|
+
/**
|
|
58781
|
+
* 计算线段长度
|
|
58782
|
+
*/
|
|
58783
|
+
calculateLineLength(coordinates2) {
|
|
58784
|
+
let length = 0;
|
|
58785
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
58786
|
+
const dx = coordinates2[i + 1][0] - coordinates2[i][0];
|
|
58787
|
+
const dy = coordinates2[i + 1][1] - coordinates2[i][1];
|
|
58788
|
+
length += Math.sqrt(dx * dx + dy * dy);
|
|
58789
|
+
}
|
|
58790
|
+
return length;
|
|
58791
|
+
}
|
|
58792
|
+
/**
|
|
58793
|
+
* 获取线段中心点
|
|
58794
|
+
*/
|
|
58795
|
+
getLineCenter(coordinates2) {
|
|
58796
|
+
const totalLength = this.calculateLineLength(coordinates2);
|
|
58797
|
+
const halfLength = totalLength / 2;
|
|
58798
|
+
let currentLength = 0;
|
|
58799
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
58800
|
+
const segmentLength = Math.sqrt(
|
|
58801
|
+
Math.pow(coordinates2[i + 1][0] - coordinates2[i][0], 2) + Math.pow(coordinates2[i + 1][1] - coordinates2[i][1], 2)
|
|
58802
|
+
);
|
|
58803
|
+
if (currentLength + segmentLength >= halfLength) {
|
|
58804
|
+
const ratio = (halfLength - currentLength) / segmentLength;
|
|
58805
|
+
return [
|
|
58806
|
+
coordinates2[i][0] + (coordinates2[i + 1][0] - coordinates2[i][0]) * ratio,
|
|
58807
|
+
coordinates2[i][1] + (coordinates2[i + 1][1] - coordinates2[i][1]) * ratio
|
|
58808
|
+
];
|
|
58809
|
+
}
|
|
58810
|
+
currentLength += segmentLength;
|
|
58811
|
+
}
|
|
58812
|
+
return coordinates2[Math.floor(coordinates2.length / 2)];
|
|
58813
|
+
}
|
|
58814
|
+
/**
|
|
58815
|
+
* 获取多线段中心点
|
|
58816
|
+
*/
|
|
58817
|
+
getMultiLineStringCenter() {
|
|
58818
|
+
const coordinates2 = this._config.coordinates;
|
|
58819
|
+
if (coordinates2.length === 0)
|
|
58820
|
+
return [0, 0];
|
|
58821
|
+
let totalX = 0;
|
|
58822
|
+
let totalY = 0;
|
|
58823
|
+
let totalPoints = 0;
|
|
58824
|
+
coordinates2.forEach((lineCoords) => {
|
|
58825
|
+
lineCoords.forEach((coord) => {
|
|
58826
|
+
totalX += coord[0];
|
|
58827
|
+
totalY += coord[1];
|
|
58828
|
+
totalPoints++;
|
|
58829
|
+
});
|
|
58830
|
+
});
|
|
58831
|
+
return totalPoints > 0 ? [totalX / totalPoints, totalY / totalPoints] : [0, 0];
|
|
58832
|
+
}
|
|
58833
|
+
/**
|
|
58834
|
+
* 根据比例获取线上的点
|
|
58835
|
+
*/
|
|
58836
|
+
getPointAtRatio(coordinates2, ratio) {
|
|
58837
|
+
if (coordinates2.length < 2)
|
|
58838
|
+
return null;
|
|
58839
|
+
const totalLength = this.calculateLineLength(coordinates2);
|
|
58840
|
+
const targetLength = totalLength * ratio;
|
|
58841
|
+
let currentLength = 0;
|
|
58842
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
58843
|
+
const segmentLength = Math.sqrt(
|
|
58844
|
+
Math.pow(coordinates2[i + 1][0] - coordinates2[i][0], 2) + Math.pow(coordinates2[i + 1][1] - coordinates2[i][1], 2)
|
|
58845
|
+
);
|
|
58846
|
+
if (currentLength + segmentLength >= targetLength) {
|
|
58847
|
+
const segmentRatio = (targetLength - currentLength) / segmentLength;
|
|
58848
|
+
return [
|
|
58849
|
+
coordinates2[i][0] + (coordinates2[i + 1][0] - coordinates2[i][0]) * segmentRatio,
|
|
58850
|
+
coordinates2[i][1] + (coordinates2[i + 1][1] - coordinates2[i][1]) * segmentRatio
|
|
58851
|
+
];
|
|
58852
|
+
}
|
|
58853
|
+
currentLength += segmentLength;
|
|
58854
|
+
}
|
|
58855
|
+
return coordinates2[coordinates2.length - 1];
|
|
58856
|
+
}
|
|
58857
|
+
/**
|
|
58858
|
+
* 根据比例获取线上的角度
|
|
58859
|
+
*/
|
|
58860
|
+
getAngleAtRatio(coordinates2, ratio) {
|
|
58861
|
+
if (coordinates2.length < 2)
|
|
58862
|
+
return 0;
|
|
58863
|
+
const totalLength = this.calculateLineLength(coordinates2);
|
|
58864
|
+
const targetLength = totalLength * ratio;
|
|
58865
|
+
let currentLength = 0;
|
|
58866
|
+
for (let i = 0; i < coordinates2.length - 1; i++) {
|
|
58867
|
+
const segmentLength = Math.sqrt(
|
|
58868
|
+
Math.pow(coordinates2[i + 1][0] - coordinates2[i][0], 2) + Math.pow(coordinates2[i + 1][1] - coordinates2[i][1], 2)
|
|
58869
|
+
);
|
|
58870
|
+
if (currentLength + segmentLength >= targetLength) {
|
|
58871
|
+
const dx2 = coordinates2[i + 1][0] - coordinates2[i][0];
|
|
58872
|
+
const dy2 = coordinates2[i + 1][1] - coordinates2[i][1];
|
|
58873
|
+
return Math.atan2(dy2, dx2);
|
|
58874
|
+
}
|
|
58875
|
+
currentLength += segmentLength;
|
|
58876
|
+
}
|
|
58877
|
+
const lastIndex = coordinates2.length - 1;
|
|
58878
|
+
const dx = coordinates2[lastIndex][0] - coordinates2[lastIndex - 1][0];
|
|
58879
|
+
const dy = coordinates2[lastIndex][1] - coordinates2[lastIndex - 1][1];
|
|
58880
|
+
return Math.atan2(dy, dx);
|
|
58881
|
+
}
|
|
58882
|
+
/**
|
|
58883
|
+
* 颜色插值
|
|
58884
|
+
*/
|
|
58885
|
+
interpolateColor(color1, color2, ratio) {
|
|
58886
|
+
if (color1.startsWith("#") && color2.startsWith("#")) {
|
|
58887
|
+
const r1 = parseInt(color1.slice(1, 3), 16);
|
|
58888
|
+
const g1 = parseInt(color1.slice(3, 5), 16);
|
|
58889
|
+
const b1 = parseInt(color1.slice(5, 7), 16);
|
|
58890
|
+
const r2 = parseInt(color2.slice(1, 3), 16);
|
|
58891
|
+
const g2 = parseInt(color2.slice(3, 5), 16);
|
|
58892
|
+
const b2 = parseInt(color2.slice(5, 7), 16);
|
|
58893
|
+
const r = Math.round(r1 + (r2 - r1) * ratio);
|
|
58894
|
+
const g3 = Math.round(g1 + (g2 - g1) * ratio);
|
|
58895
|
+
const b3 = Math.round(b1 + (b2 - b1) * ratio);
|
|
58896
|
+
return `#${r.toString(16).padStart(2, "0")}${g3.toString(16).padStart(2, "0")}${b3.toString(16).padStart(2, "0")}`;
|
|
58897
|
+
}
|
|
58898
|
+
return ratio < 0.5 ? color1 : color2;
|
|
58899
|
+
}
|
|
58900
|
+
/**
|
|
58901
|
+
* 格式化长度显示
|
|
58902
|
+
*/
|
|
58903
|
+
formatLength(length) {
|
|
58904
|
+
const unit = this._style.lengthUnit || "m";
|
|
58905
|
+
const precision = this._style.lengthPrecision || 2;
|
|
58906
|
+
switch (unit) {
|
|
58907
|
+
case "km":
|
|
58908
|
+
return `${(length / 1e3).toFixed(precision)} km`;
|
|
58909
|
+
case "mi":
|
|
58910
|
+
return `${(length / 1609.34).toFixed(precision)} mi`;
|
|
58911
|
+
case "ft":
|
|
58912
|
+
return `${(length * 3.28084).toFixed(precision)} ft`;
|
|
58913
|
+
default:
|
|
58914
|
+
return `${length.toFixed(precision)} m`;
|
|
58915
|
+
}
|
|
58916
|
+
}
|
|
58917
|
+
/**
|
|
58918
|
+
* 设置坐标
|
|
58919
|
+
*/
|
|
58920
|
+
setCoordinates(coordinates2) {
|
|
58921
|
+
this._config.coordinates = coordinates2;
|
|
58922
|
+
this.updateFeatureGeometry();
|
|
58923
|
+
this.updateStyle();
|
|
58924
|
+
}
|
|
58925
|
+
/**
|
|
58926
|
+
* 获取坐标
|
|
58927
|
+
*/
|
|
58928
|
+
getCoordinates() {
|
|
58929
|
+
return this._config.coordinates;
|
|
58930
|
+
}
|
|
58931
|
+
/**
|
|
58932
|
+
* 获取线段数量
|
|
58933
|
+
*/
|
|
58934
|
+
getLineCount() {
|
|
58935
|
+
return this._config.coordinates.length;
|
|
58936
|
+
}
|
|
58937
|
+
/**
|
|
58938
|
+
* 添加线段
|
|
58939
|
+
*/
|
|
58940
|
+
addLine(lineCoordinates) {
|
|
58941
|
+
if (lineCoordinates.length < 2) {
|
|
58942
|
+
throw new Error("Line must have at least 2 points");
|
|
58943
|
+
}
|
|
58944
|
+
this._config.coordinates.push(lineCoordinates);
|
|
58945
|
+
this.updateFeatureGeometry();
|
|
58946
|
+
this.updateStyle();
|
|
58947
|
+
}
|
|
58948
|
+
/**
|
|
58949
|
+
* 移除线段
|
|
58950
|
+
*/
|
|
58951
|
+
removeLine(index2) {
|
|
58952
|
+
if (index2 >= 0 && index2 < this._config.coordinates.length) {
|
|
58953
|
+
this._config.coordinates.splice(index2, 1);
|
|
58954
|
+
this.updateFeatureGeometry();
|
|
58955
|
+
this.updateStyle();
|
|
58956
|
+
return true;
|
|
58957
|
+
}
|
|
58958
|
+
return false;
|
|
58959
|
+
}
|
|
58960
|
+
/**
|
|
58961
|
+
* 获取总长度
|
|
58962
|
+
*/
|
|
58963
|
+
getTotalLength(unit = "m") {
|
|
58964
|
+
let totalLength = 0;
|
|
58965
|
+
this._config.coordinates.forEach((lineCoords) => {
|
|
58966
|
+
totalLength += this.calculateLineLength(lineCoords);
|
|
58967
|
+
});
|
|
58968
|
+
switch (unit) {
|
|
58969
|
+
case "km":
|
|
58970
|
+
return totalLength / 1e3;
|
|
58971
|
+
case "mi":
|
|
58972
|
+
return totalLength / 1609.34;
|
|
58973
|
+
case "ft":
|
|
58974
|
+
return totalLength * 3.28084;
|
|
58975
|
+
default:
|
|
58976
|
+
return totalLength;
|
|
58977
|
+
}
|
|
58978
|
+
}
|
|
58979
|
+
/**
|
|
58980
|
+
* 获取边界框
|
|
58981
|
+
*/
|
|
58982
|
+
getBounds() {
|
|
58983
|
+
const coordinates2 = this._config.coordinates;
|
|
58984
|
+
if (coordinates2.length === 0)
|
|
58985
|
+
return null;
|
|
58986
|
+
let minX = Infinity;
|
|
58987
|
+
let minY = Infinity;
|
|
58988
|
+
let maxX = -Infinity;
|
|
58989
|
+
let maxY = -Infinity;
|
|
58990
|
+
coordinates2.forEach((lineCoords) => {
|
|
58991
|
+
lineCoords.forEach((coord) => {
|
|
58992
|
+
minX = Math.min(minX, coord[0]);
|
|
58993
|
+
minY = Math.min(minY, coord[1]);
|
|
58994
|
+
maxX = Math.max(maxX, coord[0]);
|
|
58995
|
+
maxY = Math.max(maxY, coord[1]);
|
|
58996
|
+
});
|
|
58997
|
+
});
|
|
58998
|
+
return [minX, minY, maxX, maxY];
|
|
58999
|
+
}
|
|
59000
|
+
/**
|
|
59001
|
+
* 设置线条样式
|
|
59002
|
+
*/
|
|
59003
|
+
setStrokeStyle(options) {
|
|
59004
|
+
if (options.color)
|
|
59005
|
+
this._style.strokeColor = options.color;
|
|
59006
|
+
if (options.width !== void 0)
|
|
59007
|
+
this._style.strokeWidth = options.width;
|
|
59008
|
+
if (options.dash)
|
|
59009
|
+
this._style.strokeDash = options.dash;
|
|
59010
|
+
if (options.opacity !== void 0)
|
|
59011
|
+
this._style.strokeOpacity = options.opacity;
|
|
59012
|
+
if (options.lineCap)
|
|
59013
|
+
this._style.strokeLineCap = options.lineCap;
|
|
59014
|
+
if (options.lineJoin)
|
|
59015
|
+
this._style.strokeLineJoin = options.lineJoin;
|
|
59016
|
+
this.updateStyle();
|
|
59017
|
+
}
|
|
59018
|
+
/**
|
|
59019
|
+
* 设置箭头显示
|
|
59020
|
+
*/
|
|
59021
|
+
setArrowsVisible(visible, options) {
|
|
59022
|
+
this._style.showArrows = visible;
|
|
59023
|
+
if (options == null ? void 0 : options.size)
|
|
59024
|
+
this._style.arrowSize = options.size;
|
|
59025
|
+
if (options == null ? void 0 : options.color)
|
|
59026
|
+
this._style.arrowColor = options.color;
|
|
59027
|
+
if (options == null ? void 0 : options.spacing)
|
|
59028
|
+
this._style.arrowSpacing = options.spacing;
|
|
59029
|
+
if (options == null ? void 0 : options.style)
|
|
59030
|
+
this._style.arrowStyle = options.style;
|
|
59031
|
+
this.updateStyle();
|
|
59032
|
+
}
|
|
59033
|
+
/**
|
|
59034
|
+
* 设置端点显示
|
|
59035
|
+
*/
|
|
59036
|
+
setEndPointsVisible(options) {
|
|
59037
|
+
if (options.showStart !== void 0)
|
|
59038
|
+
this._style.showStartPoint = options.showStart;
|
|
59039
|
+
if (options.showEnd !== void 0)
|
|
59040
|
+
this._style.showEndPoint = options.showEnd;
|
|
59041
|
+
if (options.startStyle)
|
|
59042
|
+
this._style.startPointStyle = options.startStyle;
|
|
59043
|
+
if (options.endStyle)
|
|
59044
|
+
this._style.endPointStyle = options.endStyle;
|
|
59045
|
+
if (options.size)
|
|
59046
|
+
this._style.pointSize = options.size;
|
|
59047
|
+
if (options.startColor)
|
|
59048
|
+
this._style.startPointColor = options.startColor;
|
|
59049
|
+
if (options.endColor)
|
|
59050
|
+
this._style.endPointColor = options.endColor;
|
|
59051
|
+
this.updateStyle();
|
|
59052
|
+
}
|
|
59053
|
+
/**
|
|
59054
|
+
* 设置线段索引显示
|
|
59055
|
+
*/
|
|
59056
|
+
setLineIndexVisible(visible, options) {
|
|
59057
|
+
this._style.showLineIndex = visible;
|
|
59058
|
+
if (options == null ? void 0 : options.fontSize)
|
|
59059
|
+
this._style.indexFontSize = options.fontSize;
|
|
59060
|
+
if (options == null ? void 0 : options.color)
|
|
59061
|
+
this._style.indexColor = options.color;
|
|
59062
|
+
if (options == null ? void 0 : options.offset)
|
|
59063
|
+
this._style.indexOffset = options.offset;
|
|
59064
|
+
this.updateStyle();
|
|
59065
|
+
}
|
|
59066
|
+
/**
|
|
59067
|
+
* 设置长度显示
|
|
59068
|
+
*/
|
|
59069
|
+
setLengthVisible(visible, options) {
|
|
59070
|
+
this._style.showLength = visible;
|
|
59071
|
+
if (options == null ? void 0 : options.unit)
|
|
59072
|
+
this._style.lengthUnit = options.unit;
|
|
59073
|
+
if ((options == null ? void 0 : options.precision) !== void 0)
|
|
59074
|
+
this._style.lengthPrecision = options.precision;
|
|
59075
|
+
if (options == null ? void 0 : options.position)
|
|
59076
|
+
this._style.lengthPosition = options.position;
|
|
59077
|
+
this.updateStyle();
|
|
59078
|
+
}
|
|
59079
|
+
/**
|
|
59080
|
+
* 设置分组样式
|
|
59081
|
+
*/
|
|
59082
|
+
setGroupStyles(options) {
|
|
59083
|
+
if (options.colors)
|
|
59084
|
+
this._style.groupColors = options.colors;
|
|
59085
|
+
if (options.widths)
|
|
59086
|
+
this._style.groupWidths = options.widths;
|
|
59087
|
+
if (options.dashes)
|
|
59088
|
+
this._style.groupDashes = options.dashes;
|
|
59089
|
+
this.updateStyle();
|
|
59090
|
+
}
|
|
59091
|
+
/**
|
|
59092
|
+
* 创建实例
|
|
59093
|
+
*/
|
|
59094
|
+
createInstance(config) {
|
|
59095
|
+
return new MultiLineStringDrawing(config);
|
|
59096
|
+
}
|
|
59097
|
+
/**
|
|
59098
|
+
* 从JSON反序列化
|
|
59099
|
+
*/
|
|
59100
|
+
static fromJSON(data) {
|
|
59101
|
+
const config = {
|
|
59102
|
+
id: data.id,
|
|
59103
|
+
type: "multilinestring",
|
|
59104
|
+
name: data.name,
|
|
59105
|
+
coordinates: data.coordinates,
|
|
59106
|
+
properties: data.properties || {},
|
|
59107
|
+
style: data.style || {},
|
|
59108
|
+
visible: data.visible !== false
|
|
59109
|
+
};
|
|
59110
|
+
return new MultiLineStringDrawing(config);
|
|
59111
|
+
}
|
|
59112
|
+
/**
|
|
59113
|
+
* 从GeoJSON创建MultiLineStringDrawing
|
|
59114
|
+
*/
|
|
59115
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
59116
|
+
var _a2;
|
|
59117
|
+
if (geoJsonFeature.geometry.type !== "MultiLineString") {
|
|
59118
|
+
throw new Error("GeoJSON feature must be of type MultiLineString");
|
|
59119
|
+
}
|
|
59120
|
+
const config = {
|
|
59121
|
+
id: geoJsonFeature.id || `multilinestring_${Date.now()}`,
|
|
59122
|
+
type: "multilinestring",
|
|
59123
|
+
name: ((_a2 = geoJsonFeature.properties) == null ? void 0 : _a2.name) || "多线段",
|
|
59124
|
+
coordinates: geoJsonFeature.geometry.coordinates,
|
|
59125
|
+
properties: geoJsonFeature.properties || {},
|
|
59126
|
+
style: {},
|
|
59127
|
+
visible: true
|
|
59128
|
+
};
|
|
59129
|
+
return new MultiLineStringDrawing(config);
|
|
59130
|
+
}
|
|
59131
|
+
/**
|
|
59132
|
+
* 添加透明度到颜色
|
|
59133
|
+
*/
|
|
59134
|
+
addOpacityToColor(color2, opacity2) {
|
|
59135
|
+
if (opacity2 >= 1)
|
|
59136
|
+
return color2;
|
|
59137
|
+
if (color2.startsWith("#")) {
|
|
59138
|
+
const hex = color2.slice(1);
|
|
59139
|
+
const r = parseInt(hex.substr(0, 2), 16);
|
|
59140
|
+
const g2 = parseInt(hex.substr(2, 2), 16);
|
|
59141
|
+
const b2 = parseInt(hex.substr(4, 2), 16);
|
|
59142
|
+
return `rgba(${r}, ${g2}, ${b2}, ${opacity2})`;
|
|
59143
|
+
}
|
|
59144
|
+
if (color2.startsWith("rgba")) {
|
|
59145
|
+
return color2.replace(/[\d\.]+\)$/g, `${opacity2})`);
|
|
59146
|
+
}
|
|
59147
|
+
if (color2.startsWith("rgb")) {
|
|
59148
|
+
return color2.replace("rgb", "rgba").replace(")", `, ${opacity2})`);
|
|
59149
|
+
}
|
|
59150
|
+
return color2;
|
|
59151
|
+
}
|
|
59152
|
+
}
|
|
59153
|
+
class MultiLineStringDrawingFactory {
|
|
56592
59154
|
static create(config) {
|
|
56593
|
-
return new
|
|
59155
|
+
return new MultiLineStringDrawing(config);
|
|
56594
59156
|
}
|
|
56595
59157
|
static getType() {
|
|
56596
|
-
return "
|
|
59158
|
+
return "multilinestring";
|
|
56597
59159
|
}
|
|
56598
59160
|
static getSupportedTypes() {
|
|
56599
|
-
return ["
|
|
59161
|
+
return ["multilinestring", "multi-linestring", "multiline"];
|
|
56600
59162
|
}
|
|
56601
59163
|
/**
|
|
56602
|
-
*
|
|
59164
|
+
* 从GeoJSON创建
|
|
56603
59165
|
*/
|
|
56604
|
-
static
|
|
59166
|
+
static fromGeoJSON(geoJsonFeature) {
|
|
59167
|
+
return MultiLineStringDrawing.fromGeoJSON(geoJsonFeature);
|
|
59168
|
+
}
|
|
59169
|
+
/**
|
|
59170
|
+
* 创建预设样式的多线段
|
|
59171
|
+
*/
|
|
59172
|
+
static createPreset(coordinates2, preset, options) {
|
|
56605
59173
|
const presetStyles = {
|
|
56606
|
-
default: {
|
|
56607
|
-
|
|
56608
|
-
|
|
56609
|
-
|
|
56610
|
-
|
|
56611
|
-
},
|
|
56612
|
-
highlight: {
|
|
56613
|
-
fillColor: "#ffeb3b",
|
|
56614
|
-
strokeColor: "#ff9800",
|
|
56615
|
-
fillOpacity: 0.4,
|
|
56616
|
-
strokeOpacity: 1
|
|
56617
|
-
},
|
|
56618
|
-
warning: {
|
|
56619
|
-
fillColor: "#e6a23c",
|
|
56620
|
-
strokeColor: "#e6a23c",
|
|
56621
|
-
fillOpacity: 0.3,
|
|
56622
|
-
strokeOpacity: 1
|
|
56623
|
-
},
|
|
56624
|
-
success: {
|
|
56625
|
-
fillColor: "#67c23a",
|
|
56626
|
-
strokeColor: "#67c23a",
|
|
56627
|
-
fillOpacity: 0.3,
|
|
56628
|
-
strokeOpacity: 1
|
|
56629
|
-
},
|
|
56630
|
-
danger: {
|
|
56631
|
-
fillColor: "#f56c6c",
|
|
56632
|
-
strokeColor: "#f56c6c",
|
|
56633
|
-
fillOpacity: 0.3,
|
|
56634
|
-
strokeOpacity: 1
|
|
56635
|
-
}
|
|
59174
|
+
default: { strokeColor: "#409eff" },
|
|
59175
|
+
highlight: { strokeColor: "#e6a23c" },
|
|
59176
|
+
warning: { strokeColor: "#f56c6c" },
|
|
59177
|
+
success: { strokeColor: "#67c23a" },
|
|
59178
|
+
danger: { strokeColor: "#f56c6c" }
|
|
56636
59179
|
};
|
|
59180
|
+
const style = presetStyles[preset];
|
|
56637
59181
|
const config = {
|
|
56638
|
-
type,
|
|
56639
|
-
name: options == null ? void 0 : options.name,
|
|
59182
|
+
type: "multilinestring",
|
|
56640
59183
|
coordinates: coordinates2,
|
|
59184
|
+
name: (options == null ? void 0 : options.name) || "多线段",
|
|
56641
59185
|
style: {
|
|
56642
|
-
...
|
|
59186
|
+
...style,
|
|
59187
|
+
strokeWidth: 2,
|
|
59188
|
+
strokeOpacity: 1,
|
|
56643
59189
|
textContent: options == null ? void 0 : options.text,
|
|
56644
|
-
|
|
56645
|
-
|
|
59190
|
+
showArrows: (options == null ? void 0 : options.showArrows) || false,
|
|
59191
|
+
showStartPoint: (options == null ? void 0 : options.showEndPoints) || false,
|
|
59192
|
+
showEndPoint: (options == null ? void 0 : options.showEndPoints) || false,
|
|
59193
|
+
showLength: (options == null ? void 0 : options.showLength) || false,
|
|
59194
|
+
showLineIndex: (options == null ? void 0 : options.showIndex) || false
|
|
56646
59195
|
}
|
|
56647
59196
|
};
|
|
56648
|
-
return new
|
|
59197
|
+
return new MultiLineStringDrawing(config);
|
|
56649
59198
|
}
|
|
56650
59199
|
}
|
|
56651
59200
|
class ImageDrawing extends BaseDrawing {
|
|
@@ -57854,6 +60403,11 @@ class DrawingManager {
|
|
|
57854
60403
|
__publicField(this, "_currentDrawingStyle", null);
|
|
57855
60404
|
__publicField(this, "_tooltipHelper", null);
|
|
57856
60405
|
__publicField(this, "_pointerMoveListener", null);
|
|
60406
|
+
// 多线段绘制状态
|
|
60407
|
+
__publicField(this, "_multiLineStringDrawing", null);
|
|
60408
|
+
__publicField(this, "_multiLineStringCoordinates", []);
|
|
60409
|
+
__publicField(this, "_multiPolygonDrawing", null);
|
|
60410
|
+
__publicField(this, "_multiPolygonCoordinates", []);
|
|
57857
60411
|
/**
|
|
57858
60412
|
* 创建星形几何函数
|
|
57859
60413
|
*/
|
|
@@ -57879,10 +60433,7 @@ class DrawingManager {
|
|
|
57879
60433
|
for (let i = 0; i < points * 2; i++) {
|
|
57880
60434
|
const r = i % 2 === 0 ? outerRadius : innerRadius;
|
|
57881
60435
|
const a2 = i * angle2 - Math.PI / 2;
|
|
57882
|
-
coords.push([
|
|
57883
|
-
center[0] + r * Math.cos(a2),
|
|
57884
|
-
center[1] + r * Math.sin(a2)
|
|
57885
|
-
]);
|
|
60436
|
+
coords.push([center[0] + r * Math.cos(a2), center[1] + r * Math.sin(a2)]);
|
|
57886
60437
|
}
|
|
57887
60438
|
coords.push(coords[0]);
|
|
57888
60439
|
try {
|
|
@@ -57944,9 +60495,9 @@ class DrawingManager {
|
|
|
57944
60495
|
deleteCondition: (event) => {
|
|
57945
60496
|
return event.originalEvent.altKey && event.type === "singleclick";
|
|
57946
60497
|
},
|
|
57947
|
-
//
|
|
57948
|
-
insertVertexCondition: (
|
|
57949
|
-
return
|
|
60498
|
+
// 禁用插入顶点条件
|
|
60499
|
+
insertVertexCondition: () => {
|
|
60500
|
+
return false;
|
|
57950
60501
|
}
|
|
57951
60502
|
});
|
|
57952
60503
|
this._modifyInteraction.on("modifystart", (event) => {
|
|
@@ -58097,6 +60648,9 @@ class DrawingManager {
|
|
|
58097
60648
|
case "rectangle":
|
|
58098
60649
|
case "star":
|
|
58099
60650
|
case "text":
|
|
60651
|
+
case "multipoint":
|
|
60652
|
+
case "multilinestring":
|
|
60653
|
+
case "multipolygon":
|
|
58100
60654
|
this.setupDrawInteraction(mode);
|
|
58101
60655
|
this.enableSelectAndModify(false);
|
|
58102
60656
|
this.showTooltip(mode);
|
|
@@ -58163,6 +60717,31 @@ class DrawingManager {
|
|
|
58163
60717
|
case "text":
|
|
58164
60718
|
type = "Point";
|
|
58165
60719
|
break;
|
|
60720
|
+
case "multipoint":
|
|
60721
|
+
type = "LineString";
|
|
60722
|
+
geometryFunction = (coordinates2, geometry) => {
|
|
60723
|
+
if (!coordinates2 || coordinates2.length === 0) {
|
|
60724
|
+
return null;
|
|
60725
|
+
}
|
|
60726
|
+
if (geometry && geometry instanceof MultiPoint$1) {
|
|
60727
|
+
geometry.setCoordinates(coordinates2);
|
|
60728
|
+
return geometry;
|
|
60729
|
+
}
|
|
60730
|
+
return new MultiPoint$1(coordinates2);
|
|
60731
|
+
};
|
|
60732
|
+
break;
|
|
60733
|
+
case "multilinestring":
|
|
60734
|
+
type = "LineString";
|
|
60735
|
+
if (this._multiLineStringCoordinates.length === 0 && !this._multiLineStringDrawing) {
|
|
60736
|
+
this._multiLineStringCoordinates = [];
|
|
60737
|
+
this._multiLineStringDrawing = null;
|
|
60738
|
+
}
|
|
60739
|
+
break;
|
|
60740
|
+
case "multipolygon":
|
|
60741
|
+
type = "Polygon";
|
|
60742
|
+
this._multiPolygonCoordinates = [];
|
|
60743
|
+
this._multiPolygonDrawing = null;
|
|
60744
|
+
break;
|
|
58166
60745
|
default:
|
|
58167
60746
|
return;
|
|
58168
60747
|
}
|
|
@@ -58171,7 +60750,15 @@ class DrawingManager {
|
|
|
58171
60750
|
source: this._source,
|
|
58172
60751
|
type,
|
|
58173
60752
|
geometryFunction,
|
|
58174
|
-
style: drawStyle
|
|
60753
|
+
style: drawStyle,
|
|
60754
|
+
// 允许绘制操作
|
|
60755
|
+
condition: (event) => {
|
|
60756
|
+
return !event.originalEvent.altKey && !event.originalEvent.ctrlKey && !event.originalEvent.metaKey;
|
|
60757
|
+
},
|
|
60758
|
+
// 结束条件(根据不同类型判断)
|
|
60759
|
+
finishCondition: (event) => {
|
|
60760
|
+
return true;
|
|
60761
|
+
}
|
|
58175
60762
|
});
|
|
58176
60763
|
this._drawInteraction.on("drawstart", (event) => {
|
|
58177
60764
|
this.handleDrawStart(event);
|
|
@@ -58224,6 +60811,20 @@ class DrawingManager {
|
|
|
58224
60811
|
lineDash: this._currentDrawingStyle.strokeDasharray
|
|
58225
60812
|
})
|
|
58226
60813
|
});
|
|
60814
|
+
case "multipoint":
|
|
60815
|
+
return new Style$1({
|
|
60816
|
+
image: new CircleStyle$1({
|
|
60817
|
+
radius: 6,
|
|
60818
|
+
fill: new Fill$1({ color: "rgba(64, 158, 255, 0.8)" }),
|
|
60819
|
+
stroke: new Stroke$1({ color: "#ffffff", width: 2 })
|
|
60820
|
+
}),
|
|
60821
|
+
// 连接线样式
|
|
60822
|
+
stroke: new Stroke$1({
|
|
60823
|
+
color: "rgba(64, 158, 255, 0.6)",
|
|
60824
|
+
width: 1,
|
|
60825
|
+
lineDash: [5, 5]
|
|
60826
|
+
})
|
|
60827
|
+
});
|
|
58227
60828
|
case "polygon":
|
|
58228
60829
|
case "circle":
|
|
58229
60830
|
case "rectangle":
|
|
@@ -58249,6 +60850,11 @@ class DrawingManager {
|
|
|
58249
60850
|
if (this._snapInteraction) {
|
|
58250
60851
|
this._map.removeInteraction(this._snapInteraction);
|
|
58251
60852
|
}
|
|
60853
|
+
this._multiLineStringCoordinates = [];
|
|
60854
|
+
this._multiLineStringDrawing = null;
|
|
60855
|
+
this._multiPolygonCoordinates = [];
|
|
60856
|
+
this._multiPolygonDrawing = null;
|
|
60857
|
+
this.hideTooltip();
|
|
58252
60858
|
}
|
|
58253
60859
|
/**
|
|
58254
60860
|
* 启用/禁用选择和修改交互
|
|
@@ -58314,11 +60920,32 @@ class DrawingManager {
|
|
|
58314
60920
|
case "text":
|
|
58315
60921
|
drawing = this.createTextDrawing(feature);
|
|
58316
60922
|
break;
|
|
60923
|
+
case "multipoint":
|
|
60924
|
+
drawing = this.createMultiPointDrawing(feature);
|
|
60925
|
+
break;
|
|
60926
|
+
case "multilinestring":
|
|
60927
|
+
console.log("HandleDrawEnd: Processing multilinestring mode");
|
|
60928
|
+
drawing = this.handleMultiLineStringDrawEnd(feature);
|
|
60929
|
+
console.log(
|
|
60930
|
+
"HandleDrawEnd: MultiLineString result:",
|
|
60931
|
+
drawing ? "Drawing created" : "Still drawing"
|
|
60932
|
+
);
|
|
60933
|
+
if (!drawing)
|
|
60934
|
+
return;
|
|
60935
|
+
break;
|
|
60936
|
+
case "multipolygon":
|
|
60937
|
+
drawing = this.handleMultiPolygonDrawEnd(feature);
|
|
60938
|
+
if (!drawing)
|
|
60939
|
+
return;
|
|
60940
|
+
break;
|
|
58317
60941
|
default:
|
|
58318
60942
|
return;
|
|
58319
60943
|
}
|
|
60944
|
+
console.log("HandleDrawEnd: Adding drawing to manager:", drawing.getId());
|
|
58320
60945
|
this.addDrawing(drawing);
|
|
58321
|
-
|
|
60946
|
+
console.log("HandleDrawEnd: Drawing added successfully");
|
|
60947
|
+
if (this._currentMode === "multilinestring" || this._currentMode === "multipolygon" || this._config.allowContinuousDrawing === false) {
|
|
60948
|
+
console.log("HandleDrawEnd: Setting mode to none");
|
|
58322
60949
|
this.setMode("none");
|
|
58323
60950
|
}
|
|
58324
60951
|
this.emit("drawing-end", drawing);
|
|
@@ -58421,10 +61048,7 @@ class DrawingManager {
|
|
|
58421
61048
|
for (let i = 0; i < points * 2; i++) {
|
|
58422
61049
|
const r = i % 2 === 0 ? outerRadius : innerRadius;
|
|
58423
61050
|
const a2 = i * angle2 - Math.PI / 2;
|
|
58424
|
-
coords.push([
|
|
58425
|
-
center[0] + r * Math.cos(a2),
|
|
58426
|
-
center[1] + r * Math.sin(a2)
|
|
58427
|
-
]);
|
|
61051
|
+
coords.push([center[0] + r * Math.cos(a2), center[1] + r * Math.sin(a2)]);
|
|
58428
61052
|
}
|
|
58429
61053
|
coords.push(coords[0]);
|
|
58430
61054
|
return new Polygon$1([coords]);
|
|
@@ -58439,7 +61063,9 @@ class DrawingManager {
|
|
|
58439
61063
|
radius: 50
|
|
58440
61064
|
};
|
|
58441
61065
|
}
|
|
58442
|
-
const outerPoints = coordinates2.filter(
|
|
61066
|
+
const outerPoints = coordinates2.filter(
|
|
61067
|
+
(_2, index2) => index2 % 2 === 0 && index2 < 10
|
|
61068
|
+
);
|
|
58443
61069
|
if (outerPoints.length === 0) {
|
|
58444
61070
|
return {
|
|
58445
61071
|
center: coordinates2[0] || [0, 0],
|
|
@@ -58467,10 +61093,7 @@ class DrawingManager {
|
|
|
58467
61093
|
for (let i = 0; i < points * 2; i++) {
|
|
58468
61094
|
const r = i % 2 === 0 ? radius : innerRadius;
|
|
58469
61095
|
const a2 = i * angle2 - Math.PI / 2;
|
|
58470
|
-
coords.push([
|
|
58471
|
-
center[0] + r * Math.cos(a2),
|
|
58472
|
-
center[1] + r * Math.sin(a2)
|
|
58473
|
-
]);
|
|
61096
|
+
coords.push([center[0] + r * Math.cos(a2), center[1] + r * Math.sin(a2)]);
|
|
58474
61097
|
}
|
|
58475
61098
|
coords.push(coords[0]);
|
|
58476
61099
|
return new Polygon$1([coords]);
|
|
@@ -58564,6 +61187,233 @@ class DrawingManager {
|
|
|
58564
61187
|
const drawing = new TextDrawing(config);
|
|
58565
61188
|
return drawing;
|
|
58566
61189
|
}
|
|
61190
|
+
/**
|
|
61191
|
+
* 创建多点标绘
|
|
61192
|
+
*/
|
|
61193
|
+
createMultiPointDrawing(feature) {
|
|
61194
|
+
const geometry = feature.getGeometry();
|
|
61195
|
+
const coordinates2 = geometry.getCoordinates();
|
|
61196
|
+
const config = {
|
|
61197
|
+
id: `multipoint_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61198
|
+
name: "多点标绘",
|
|
61199
|
+
type: "multipoint",
|
|
61200
|
+
coordinates: [coordinates2],
|
|
61201
|
+
// 将单个点包装成多点数组
|
|
61202
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61203
|
+
};
|
|
61204
|
+
const drawing = new MultiPointDrawing(config);
|
|
61205
|
+
return drawing;
|
|
61206
|
+
}
|
|
61207
|
+
/**
|
|
61208
|
+
* 处理多线段绘制结束
|
|
61209
|
+
*/
|
|
61210
|
+
handleMultiLineStringDrawEnd(feature) {
|
|
61211
|
+
debugger;
|
|
61212
|
+
const geometry = feature.getGeometry();
|
|
61213
|
+
const coordinates2 = geometry.getCoordinates();
|
|
61214
|
+
this._multiLineStringCoordinates.push(coordinates2);
|
|
61215
|
+
console.log(
|
|
61216
|
+
"MultiLineString draw end - Total segments:",
|
|
61217
|
+
this._multiLineStringCoordinates.length
|
|
61218
|
+
);
|
|
61219
|
+
console.log("Finishing MultiLineString drawing with double-click");
|
|
61220
|
+
this._source.removeFeature(feature);
|
|
61221
|
+
if (this._multiLineStringDrawing && this._multiLineStringDrawing.feature) {
|
|
61222
|
+
this._source.removeFeature(this._multiLineStringDrawing.feature);
|
|
61223
|
+
}
|
|
61224
|
+
return this.finishMultiLineStringDrawing();
|
|
61225
|
+
}
|
|
61226
|
+
/**
|
|
61227
|
+
* 完成多线段标绘
|
|
61228
|
+
*/
|
|
61229
|
+
finishMultiLineStringDrawing() {
|
|
61230
|
+
if (!this._multiLineStringCoordinates || this._multiLineStringCoordinates.length === 0) {
|
|
61231
|
+
throw new Error("No coordinates to create MultiLineString");
|
|
61232
|
+
}
|
|
61233
|
+
const validCoordinates = this._multiLineStringCoordinates.filter(
|
|
61234
|
+
(lineCoords) => lineCoords && lineCoords.length >= 2
|
|
61235
|
+
);
|
|
61236
|
+
if (validCoordinates.length === 0) {
|
|
61237
|
+
throw new Error("No valid line segments to create MultiLineString");
|
|
61238
|
+
}
|
|
61239
|
+
const config = {
|
|
61240
|
+
id: `multilinestring_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61241
|
+
name: "多线标绘",
|
|
61242
|
+
type: "multilinestring",
|
|
61243
|
+
coordinates: validCoordinates,
|
|
61244
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61245
|
+
};
|
|
61246
|
+
const drawing = new MultiLineStringDrawing(config);
|
|
61247
|
+
if (this._map && this._layer) {
|
|
61248
|
+
drawing.initialize(this._map, this._layer);
|
|
61249
|
+
console.log("MultiLineString drawing initialized and added to map");
|
|
61250
|
+
}
|
|
61251
|
+
if (this._multiLineStringDrawing && this._multiLineStringDrawing.feature) {
|
|
61252
|
+
this._source.removeFeature(this._multiLineStringDrawing.feature);
|
|
61253
|
+
}
|
|
61254
|
+
this._multiLineStringCoordinates = [];
|
|
61255
|
+
this._multiLineStringDrawing = null;
|
|
61256
|
+
console.log("MultiLineString drawing finished, setting mode to none");
|
|
61257
|
+
debugger;
|
|
61258
|
+
this.setMode("none");
|
|
61259
|
+
return drawing;
|
|
61260
|
+
}
|
|
61261
|
+
/**
|
|
61262
|
+
* 更新多线段进度显示
|
|
61263
|
+
*/
|
|
61264
|
+
updateMultiLineStringProgress() {
|
|
61265
|
+
if (!this._multiLineStringCoordinates || this._multiLineStringCoordinates.length === 0) {
|
|
61266
|
+
return;
|
|
61267
|
+
}
|
|
61268
|
+
const validCoordinates = this._multiLineStringCoordinates.filter(
|
|
61269
|
+
(lineCoords) => lineCoords && lineCoords.length >= 2
|
|
61270
|
+
);
|
|
61271
|
+
if (validCoordinates.length === 0) {
|
|
61272
|
+
return;
|
|
61273
|
+
}
|
|
61274
|
+
if (!this._multiLineStringDrawing) {
|
|
61275
|
+
const config = {
|
|
61276
|
+
id: `temp_multilinestring_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61277
|
+
name: "多线标绘(进行中)",
|
|
61278
|
+
type: "multilinestring",
|
|
61279
|
+
coordinates: [...validCoordinates],
|
|
61280
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61281
|
+
};
|
|
61282
|
+
this._multiLineStringDrawing = new MultiLineStringDrawing(config);
|
|
61283
|
+
if (this._multiLineStringDrawing.feature) {
|
|
61284
|
+
this._source.addFeature(this._multiLineStringDrawing.feature);
|
|
61285
|
+
}
|
|
61286
|
+
} else {
|
|
61287
|
+
this._multiLineStringDrawing.setCoordinates([...validCoordinates]);
|
|
61288
|
+
}
|
|
61289
|
+
this.updateMultiLineStringTooltip();
|
|
61290
|
+
}
|
|
61291
|
+
/**
|
|
61292
|
+
* 继续多线段绘制
|
|
61293
|
+
*/
|
|
61294
|
+
continueMultiLineStringDrawing() {
|
|
61295
|
+
if (this._currentMode !== "multilinestring") {
|
|
61296
|
+
console.log(
|
|
61297
|
+
"Current mode is not multilinestring, skipping continue drawing"
|
|
61298
|
+
);
|
|
61299
|
+
return;
|
|
61300
|
+
}
|
|
61301
|
+
if (this._drawInteraction) {
|
|
61302
|
+
this._map.removeInteraction(this._drawInteraction);
|
|
61303
|
+
}
|
|
61304
|
+
setTimeout(() => {
|
|
61305
|
+
if (this._currentMode === "multilinestring") {
|
|
61306
|
+
this.setupDrawInteraction("multilinestring");
|
|
61307
|
+
}
|
|
61308
|
+
}, 100);
|
|
61309
|
+
}
|
|
61310
|
+
/**
|
|
61311
|
+
* 处理多边形绘制结束
|
|
61312
|
+
*/
|
|
61313
|
+
handleMultiPolygonDrawEnd(feature) {
|
|
61314
|
+
const geometry = feature.getGeometry();
|
|
61315
|
+
const coordinates2 = geometry.getCoordinates();
|
|
61316
|
+
this._multiPolygonCoordinates.push(coordinates2);
|
|
61317
|
+
this._source.removeFeature(feature);
|
|
61318
|
+
if (this._multiPolygonDrawing && this._multiPolygonDrawing.feature) {
|
|
61319
|
+
this._source.removeFeature(this._multiPolygonDrawing.feature);
|
|
61320
|
+
}
|
|
61321
|
+
return this.finishMultiPolygonDrawing();
|
|
61322
|
+
}
|
|
61323
|
+
/**
|
|
61324
|
+
* 完成多边形标绘
|
|
61325
|
+
*/
|
|
61326
|
+
finishMultiPolygonDrawing() {
|
|
61327
|
+
const validCoordinates = this._multiPolygonCoordinates.filter(
|
|
61328
|
+
(polygonCoords) => polygonCoords && polygonCoords.length > 0 && polygonCoords[0] && polygonCoords[0].length >= 3
|
|
61329
|
+
);
|
|
61330
|
+
const config = {
|
|
61331
|
+
id: `multipolygon_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61332
|
+
name: "多面标绘",
|
|
61333
|
+
type: "multipolygon",
|
|
61334
|
+
coordinates: validCoordinates,
|
|
61335
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61336
|
+
};
|
|
61337
|
+
const drawing = new MultiPolygonDrawing(config);
|
|
61338
|
+
this._multiPolygonCoordinates = [];
|
|
61339
|
+
this._multiPolygonDrawing = null;
|
|
61340
|
+
return drawing;
|
|
61341
|
+
}
|
|
61342
|
+
/**
|
|
61343
|
+
* 更新多边形进度显示
|
|
61344
|
+
*/
|
|
61345
|
+
updateMultiPolygonProgress() {
|
|
61346
|
+
if (!this._multiPolygonCoordinates || this._multiPolygonCoordinates.length === 0) {
|
|
61347
|
+
return;
|
|
61348
|
+
}
|
|
61349
|
+
const validCoordinates = this._multiPolygonCoordinates.filter(
|
|
61350
|
+
(polygonCoords) => polygonCoords && polygonCoords.length > 0 && polygonCoords[0] && polygonCoords[0].length >= 3
|
|
61351
|
+
);
|
|
61352
|
+
if (validCoordinates.length === 0) {
|
|
61353
|
+
return;
|
|
61354
|
+
}
|
|
61355
|
+
if (!this._multiPolygonDrawing) {
|
|
61356
|
+
const config = {
|
|
61357
|
+
id: `temp_multipolygon_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61358
|
+
name: "多面标绘(进行中)",
|
|
61359
|
+
type: "multipolygon",
|
|
61360
|
+
coordinates: [...validCoordinates],
|
|
61361
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61362
|
+
};
|
|
61363
|
+
this._multiPolygonDrawing = new MultiPolygonDrawing(config);
|
|
61364
|
+
if (this._multiPolygonDrawing.feature) {
|
|
61365
|
+
this._source.addFeature(this._multiPolygonDrawing.feature);
|
|
61366
|
+
}
|
|
61367
|
+
} else {
|
|
61368
|
+
this._multiPolygonDrawing.setCoordinates([...validCoordinates]);
|
|
61369
|
+
}
|
|
61370
|
+
this.updateMultiPolygonTooltip();
|
|
61371
|
+
}
|
|
61372
|
+
/**
|
|
61373
|
+
* 继续多边形绘制
|
|
61374
|
+
*/
|
|
61375
|
+
continueMultiPolygonDrawing() {
|
|
61376
|
+
if (this._drawInteraction) {
|
|
61377
|
+
this._map.removeInteraction(this._drawInteraction);
|
|
61378
|
+
}
|
|
61379
|
+
setTimeout(() => {
|
|
61380
|
+
this.setupDrawInteraction("multipolygon");
|
|
61381
|
+
}, 100);
|
|
61382
|
+
}
|
|
61383
|
+
/**
|
|
61384
|
+
* 创建多线标绘(保留原方法作为备用)
|
|
61385
|
+
*/
|
|
61386
|
+
createMultiLineStringDrawing(feature) {
|
|
61387
|
+
const geometry = feature.getGeometry();
|
|
61388
|
+
const coordinates2 = geometry.getCoordinates();
|
|
61389
|
+
const config = {
|
|
61390
|
+
id: `multilinestring_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61391
|
+
name: "多线标绘",
|
|
61392
|
+
type: "multilinestring",
|
|
61393
|
+
coordinates: [coordinates2],
|
|
61394
|
+
// 将单条线包装成多线数组
|
|
61395
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61396
|
+
};
|
|
61397
|
+
const drawing = new MultiLineStringDrawing(config);
|
|
61398
|
+
return drawing;
|
|
61399
|
+
}
|
|
61400
|
+
/**
|
|
61401
|
+
* 创建多面标绘
|
|
61402
|
+
*/
|
|
61403
|
+
createMultiPolygonDrawing(feature) {
|
|
61404
|
+
const geometry = feature.getGeometry();
|
|
61405
|
+
const coordinates2 = geometry.getCoordinates();
|
|
61406
|
+
const config = {
|
|
61407
|
+
id: `multipolygon_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61408
|
+
name: "多面标绘",
|
|
61409
|
+
type: "multipolygon",
|
|
61410
|
+
coordinates: [coordinates2],
|
|
61411
|
+
// 将单个多边形包装成多面数组
|
|
61412
|
+
style: this._currentDrawingStyle || this._config.defaultStyle || {}
|
|
61413
|
+
};
|
|
61414
|
+
const drawing = new MultiPolygonDrawing(config);
|
|
61415
|
+
return drawing;
|
|
61416
|
+
}
|
|
58567
61417
|
/**
|
|
58568
61418
|
* 处理选择事件
|
|
58569
61419
|
*/
|
|
@@ -58751,10 +61601,9 @@ class DrawingManager {
|
|
|
58751
61601
|
drawingData.coordinates[0] += offset;
|
|
58752
61602
|
drawingData.coordinates[1] += offset;
|
|
58753
61603
|
} else if (drawingData.type === "line") {
|
|
58754
|
-
drawingData.coordinates = drawingData.coordinates.map(
|
|
58755
|
-
coord[0] + offset,
|
|
58756
|
-
|
|
58757
|
-
]);
|
|
61604
|
+
drawingData.coordinates = drawingData.coordinates.map(
|
|
61605
|
+
(coord) => [coord[0] + offset, coord[1] + offset]
|
|
61606
|
+
);
|
|
58758
61607
|
} else if (drawingData.type === "polygon") {
|
|
58759
61608
|
if (((_a2 = drawingData.config) == null ? void 0 : _a2.type) === "circle" || ((_b2 = drawingData.config) == null ? void 0 : _b2.type) === "star") {
|
|
58760
61609
|
if (drawingData.coordinates.center) {
|
|
@@ -58762,10 +61611,9 @@ class DrawingManager {
|
|
|
58762
61611
|
drawingData.coordinates.center[1] += offset;
|
|
58763
61612
|
}
|
|
58764
61613
|
} else {
|
|
58765
|
-
drawingData.coordinates = drawingData.coordinates.map(
|
|
58766
|
-
coord[0] + offset,
|
|
58767
|
-
|
|
58768
|
-
]);
|
|
61614
|
+
drawingData.coordinates = drawingData.coordinates.map(
|
|
61615
|
+
(coord) => [coord[0] + offset, coord[1] + offset]
|
|
61616
|
+
);
|
|
58769
61617
|
}
|
|
58770
61618
|
}
|
|
58771
61619
|
const newDrawing = this.createDrawingFromJSON(drawingData);
|
|
@@ -58784,7 +61632,8 @@ class DrawingManager {
|
|
|
58784
61632
|
*/
|
|
58785
61633
|
createDrawingFromJSON(data) {
|
|
58786
61634
|
try {
|
|
58787
|
-
|
|
61635
|
+
const type = (data.type || "").toLowerCase();
|
|
61636
|
+
switch (type) {
|
|
58788
61637
|
case "point":
|
|
58789
61638
|
return new PointDrawing(data);
|
|
58790
61639
|
case "line":
|
|
@@ -58793,6 +61642,16 @@ class DrawingManager {
|
|
|
58793
61642
|
return new PolygonDrawing(data);
|
|
58794
61643
|
case "text":
|
|
58795
61644
|
return new TextDrawing(data);
|
|
61645
|
+
case "multipolygon":
|
|
61646
|
+
case "multi-polygon":
|
|
61647
|
+
return new MultiPolygonDrawing(data);
|
|
61648
|
+
case "multipoint":
|
|
61649
|
+
case "multi-point":
|
|
61650
|
+
return new MultiPointDrawing(data);
|
|
61651
|
+
case "multilinestring":
|
|
61652
|
+
case "multi-linestring":
|
|
61653
|
+
case "multiline":
|
|
61654
|
+
return new MultiLineStringDrawing(data);
|
|
58796
61655
|
default:
|
|
58797
61656
|
console.warn("未知的标绘类型:", data.type);
|
|
58798
61657
|
return null;
|
|
@@ -58802,6 +61661,58 @@ class DrawingManager {
|
|
|
58802
61661
|
return null;
|
|
58803
61662
|
}
|
|
58804
61663
|
}
|
|
61664
|
+
/**
|
|
61665
|
+
* 从GeoJSON Feature创建标绘对象
|
|
61666
|
+
*/
|
|
61667
|
+
createDrawingFromGeoJSON(feature) {
|
|
61668
|
+
if (!feature || !feature.geometry) {
|
|
61669
|
+
console.warn("无效的GeoJSON Feature:", feature);
|
|
61670
|
+
return null;
|
|
61671
|
+
}
|
|
61672
|
+
const geometryType = feature.geometry.type.toLowerCase();
|
|
61673
|
+
const coordinates2 = feature.geometry.coordinates;
|
|
61674
|
+
const properties = feature.properties || {};
|
|
61675
|
+
try {
|
|
61676
|
+
let config = {
|
|
61677
|
+
id: properties.id || `${geometryType}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
61678
|
+
name: properties.name || properties.title || `${geometryType}标绘`,
|
|
61679
|
+
type: geometryType,
|
|
61680
|
+
coordinates: coordinates2,
|
|
61681
|
+
style: this._config.defaultStyle || {}
|
|
61682
|
+
};
|
|
61683
|
+
if (properties.description) {
|
|
61684
|
+
config.description = properties.description;
|
|
61685
|
+
}
|
|
61686
|
+
if (properties.category) {
|
|
61687
|
+
config.category = properties.category;
|
|
61688
|
+
}
|
|
61689
|
+
if (properties.area) {
|
|
61690
|
+
config.area = properties.area;
|
|
61691
|
+
}
|
|
61692
|
+
switch (geometryType) {
|
|
61693
|
+
case "point":
|
|
61694
|
+
return new PointDrawing(config);
|
|
61695
|
+
case "linestring":
|
|
61696
|
+
config.type = "line";
|
|
61697
|
+
return new LineDrawing(config);
|
|
61698
|
+
case "polygon":
|
|
61699
|
+
return new PolygonDrawing(config);
|
|
61700
|
+
case "multipoint":
|
|
61701
|
+
return new MultiPointDrawing(config);
|
|
61702
|
+
case "multilinestring":
|
|
61703
|
+
config.type = "multilinestring";
|
|
61704
|
+
return new MultiLineStringDrawing(config);
|
|
61705
|
+
case "multipolygon":
|
|
61706
|
+
return new MultiPolygonDrawing(config);
|
|
61707
|
+
default:
|
|
61708
|
+
console.warn("不支持的几何类型:", geometryType);
|
|
61709
|
+
return null;
|
|
61710
|
+
}
|
|
61711
|
+
} catch (error) {
|
|
61712
|
+
console.error("从GeoJSON创建标绘对象失败:", error);
|
|
61713
|
+
return null;
|
|
61714
|
+
}
|
|
61715
|
+
}
|
|
58805
61716
|
/**
|
|
58806
61717
|
* 清除所有标绘
|
|
58807
61718
|
*/
|
|
@@ -58839,7 +61750,9 @@ class DrawingManager {
|
|
|
58839
61750
|
* 导出为JSON
|
|
58840
61751
|
*/
|
|
58841
61752
|
toJSON() {
|
|
58842
|
-
const drawings = Array.from(this._drawings.values()).map(
|
|
61753
|
+
const drawings = Array.from(this._drawings.values()).map(
|
|
61754
|
+
(drawing) => drawing.toJSON()
|
|
61755
|
+
);
|
|
58843
61756
|
return {
|
|
58844
61757
|
drawings,
|
|
58845
61758
|
config: {
|
|
@@ -58918,7 +61831,6 @@ class DrawingManager {
|
|
|
58918
61831
|
if (listeners) {
|
|
58919
61832
|
listeners.forEach((listener) => {
|
|
58920
61833
|
try {
|
|
58921
|
-
;
|
|
58922
61834
|
listener(...args);
|
|
58923
61835
|
} catch (error) {
|
|
58924
61836
|
console.error(`Error in ${event} listener:`, error);
|
|
@@ -58942,6 +61854,46 @@ class DrawingManager {
|
|
|
58942
61854
|
return;
|
|
58943
61855
|
this._tooltipHelper.hide();
|
|
58944
61856
|
}
|
|
61857
|
+
/**
|
|
61858
|
+
* 更新多线段绘制的鼠标跟随提示
|
|
61859
|
+
*/
|
|
61860
|
+
updateMultiLineStringTooltip() {
|
|
61861
|
+
var _a2;
|
|
61862
|
+
if (!this._tooltipHelper)
|
|
61863
|
+
return;
|
|
61864
|
+
if (!this._multiLineStringCoordinates || this._multiLineStringCoordinates.length === 0) {
|
|
61865
|
+
return;
|
|
61866
|
+
}
|
|
61867
|
+
const lineCount = this._multiLineStringCoordinates.length;
|
|
61868
|
+
const currentLinePoints = ((_a2 = this._multiLineStringCoordinates[lineCount - 1]) == null ? void 0 : _a2.length) || 0;
|
|
61869
|
+
let tooltipText = `多线段绘制 (已绘制 ${lineCount} 条线段)`;
|
|
61870
|
+
if (currentLinePoints > 0) {
|
|
61871
|
+
tooltipText += `
|
|
61872
|
+
当前线段: ${currentLinePoints} 个点`;
|
|
61873
|
+
}
|
|
61874
|
+
tooltipText += "\n双击结束当前线段";
|
|
61875
|
+
this._tooltipHelper.updateText(tooltipText);
|
|
61876
|
+
}
|
|
61877
|
+
/**
|
|
61878
|
+
* 更新多边形绘制的鼠标跟随提示
|
|
61879
|
+
*/
|
|
61880
|
+
updateMultiPolygonTooltip() {
|
|
61881
|
+
var _a2;
|
|
61882
|
+
if (!this._tooltipHelper)
|
|
61883
|
+
return;
|
|
61884
|
+
if (!this._multiPolygonCoordinates || this._multiPolygonCoordinates.length === 0) {
|
|
61885
|
+
return;
|
|
61886
|
+
}
|
|
61887
|
+
const polygonCount = this._multiPolygonCoordinates.length;
|
|
61888
|
+
const currentPolygonRings = ((_a2 = this._multiPolygonCoordinates[polygonCount - 1]) == null ? void 0 : _a2.length) || 0;
|
|
61889
|
+
let tooltipText = `多边形绘制 (已绘制 ${polygonCount} 个多边形)`;
|
|
61890
|
+
if (currentPolygonRings > 0) {
|
|
61891
|
+
tooltipText += `
|
|
61892
|
+
当前多边形: ${currentPolygonRings} 个环`;
|
|
61893
|
+
}
|
|
61894
|
+
tooltipText += "\n双击结束当前多边形";
|
|
61895
|
+
this._tooltipHelper.updateText(tooltipText);
|
|
61896
|
+
}
|
|
58945
61897
|
/**
|
|
58946
61898
|
* 销毁管理器
|
|
58947
61899
|
*/
|
|
@@ -58987,6 +61939,13 @@ const DrawingFactoryRegistry = {
|
|
|
58987
61939
|
icon: IconDrawingFactory,
|
|
58988
61940
|
line: LineDrawingFactory,
|
|
58989
61941
|
polygon: PolygonDrawingFactory,
|
|
61942
|
+
multipolygon: MultiPolygonDrawingFactory,
|
|
61943
|
+
"multi-polygon": MultiPolygonDrawingFactory,
|
|
61944
|
+
multipoint: MultiPointDrawingFactory,
|
|
61945
|
+
"multi-point": MultiPointDrawingFactory,
|
|
61946
|
+
multilinestring: MultiLineStringDrawingFactory,
|
|
61947
|
+
"multi-linestring": MultiLineStringDrawingFactory,
|
|
61948
|
+
multiline: MultiLineStringDrawingFactory,
|
|
58990
61949
|
image: ImageDrawingFactory,
|
|
58991
61950
|
military: MilitaryDrawingFactory
|
|
58992
61951
|
};
|
|
@@ -64190,6 +67149,7 @@ const _sfc_main$c = {
|
|
|
64190
67149
|
{ label: "点", value: "point" },
|
|
64191
67150
|
{ label: "线", value: "line" },
|
|
64192
67151
|
{ label: "面", value: "polygon" },
|
|
67152
|
+
{ label: "多几何", value: "multi" },
|
|
64193
67153
|
{ label: "复合标绘", value: "composite" },
|
|
64194
67154
|
{ label: "编辑工具", value: "edit" }
|
|
64195
67155
|
];
|
|
@@ -64225,6 +67185,11 @@ const _sfc_main$c = {
|
|
|
64225
67185
|
{ icon: "i-carbon-chart-area", label: "面带文字", type: "polygon-with-text" },
|
|
64226
67186
|
{ icon: "i-carbon-map", label: "标注点", type: "marker-with-label" }
|
|
64227
67187
|
],
|
|
67188
|
+
multi: [
|
|
67189
|
+
{ icon: "i-carbon-location", label: "多点", type: "multi-point" },
|
|
67190
|
+
{ icon: "i-carbon-chart-multiline", label: "多线", type: "multi-line" },
|
|
67191
|
+
{ icon: "i-carbon-layers", label: "多面", type: "multi-polygon" }
|
|
67192
|
+
],
|
|
64228
67193
|
edit: [
|
|
64229
67194
|
{ icon: "i-carbon-cursor-1", label: "选择", type: "select" },
|
|
64230
67195
|
{ icon: "i-carbon-edit", label: "编辑", type: "modify" },
|
|
@@ -64233,7 +67198,7 @@ const _sfc_main$c = {
|
|
|
64233
67198
|
{ icon: "i-carbon-close", label: "取消", type: "cancel" }
|
|
64234
67199
|
]
|
|
64235
67200
|
};
|
|
64236
|
-
const selectedType = ref("
|
|
67201
|
+
const selectedType = ref("multi");
|
|
64237
67202
|
const activeDrawingTool = ref(null);
|
|
64238
67203
|
const continuousDrawing = ref(false);
|
|
64239
67204
|
const currentTools = computed(() => toolMap[selectedType.value] || []);
|
|
@@ -64580,6 +67545,46 @@ const _sfc_main$c = {
|
|
|
64580
67545
|
});
|
|
64581
67546
|
ElMessage.info(`开始绘制${tool.label},请在地图上点击添加台风GIF点`);
|
|
64582
67547
|
break;
|
|
67548
|
+
case "multi-point":
|
|
67549
|
+
drawingManager.value.setMode("multipoint", {
|
|
67550
|
+
image: {
|
|
67551
|
+
radius: 6,
|
|
67552
|
+
fill: {
|
|
67553
|
+
color: "#ff6b35"
|
|
67554
|
+
},
|
|
67555
|
+
stroke: {
|
|
67556
|
+
color: "#ffffff",
|
|
67557
|
+
width: 2
|
|
67558
|
+
}
|
|
67559
|
+
},
|
|
67560
|
+
allowContinuousDrawing: continuousDrawing.value
|
|
67561
|
+
});
|
|
67562
|
+
ElMessage.info(`开始绘制${tool.label},请在地图上点击添加多个点位,双击结束`);
|
|
67563
|
+
break;
|
|
67564
|
+
case "multi-line":
|
|
67565
|
+
drawingManager.value.setMode("multilinestring", {
|
|
67566
|
+
stroke: {
|
|
67567
|
+
color: "#722ed1",
|
|
67568
|
+
width: 3,
|
|
67569
|
+
lineDash: [10, 5]
|
|
67570
|
+
},
|
|
67571
|
+
allowContinuousDrawing: continuousDrawing.value
|
|
67572
|
+
});
|
|
67573
|
+
ElMessage.info(`开始绘制${tool.label},请在地图上绘制多条线段,双击结束每条线`);
|
|
67574
|
+
break;
|
|
67575
|
+
case "multi-polygon":
|
|
67576
|
+
drawingManager.value.setMode("multipolygon", {
|
|
67577
|
+
fill: {
|
|
67578
|
+
color: "rgba(114, 46, 209, 0.3)"
|
|
67579
|
+
},
|
|
67580
|
+
stroke: {
|
|
67581
|
+
color: "#722ed1",
|
|
67582
|
+
width: 2
|
|
67583
|
+
},
|
|
67584
|
+
allowContinuousDrawing: continuousDrawing.value
|
|
67585
|
+
});
|
|
67586
|
+
ElMessage.info(`开始绘制${tool.label},请在地图上绘制多个多边形,双击结束每个多边形`);
|
|
67587
|
+
break;
|
|
64583
67588
|
case "select":
|
|
64584
67589
|
drawingManager.value.setMode("select");
|
|
64585
67590
|
ElMessage.info("已切换到选择模式,点击图形进行选择");
|
|
@@ -64687,7 +67692,7 @@ const _sfc_main$c = {
|
|
|
64687
67692
|
};
|
|
64688
67693
|
}
|
|
64689
67694
|
};
|
|
64690
|
-
const MarkTab = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-
|
|
67695
|
+
const MarkTab = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-019ab9dd"]]);
|
|
64691
67696
|
const _hoisted_1$9 = { class: "list-tab-container" };
|
|
64692
67697
|
const _hoisted_2$9 = { class: "toolbar" };
|
|
64693
67698
|
const _hoisted_3$8 = { class: "toolbar-left" };
|
|
@@ -66836,10 +69841,12 @@ class SearchMarkerManager {
|
|
|
66836
69841
|
}
|
|
66837
69842
|
}
|
|
66838
69843
|
class MapManager {
|
|
66839
|
-
constructor(config) {
|
|
69844
|
+
constructor(config, eventBus, storage) {
|
|
66840
69845
|
__publicField(this, "map", null);
|
|
66841
69846
|
__publicField(this, "config");
|
|
66842
69847
|
__publicField(this, "eventCallbacks", {});
|
|
69848
|
+
__publicField(this, "eventBus");
|
|
69849
|
+
__publicField(this, "storage");
|
|
66843
69850
|
// 管理器实例
|
|
66844
69851
|
__publicField(this, "eventManager", null);
|
|
66845
69852
|
__publicField(this, "searchMarkerManager", null);
|
|
@@ -66854,6 +69861,8 @@ class MapManager {
|
|
|
66854
69861
|
__publicField(this, "measurementType", null);
|
|
66855
69862
|
__publicField(this, "contextMenuCoordinate", [0, 0]);
|
|
66856
69863
|
this.config = config;
|
|
69864
|
+
this.eventBus = eventBus;
|
|
69865
|
+
this.storage = storage;
|
|
66857
69866
|
}
|
|
66858
69867
|
/**
|
|
66859
69868
|
* 初始化地图
|
|
@@ -66920,7 +69929,7 @@ class MapManager {
|
|
|
66920
69929
|
initManagers() {
|
|
66921
69930
|
if (!this.map)
|
|
66922
69931
|
return;
|
|
66923
|
-
this.layerManager = new LayerManager(this.map);
|
|
69932
|
+
this.layerManager = new LayerManager(this.map, this.eventBus, this.storage);
|
|
66924
69933
|
const eventManagerConfig = {
|
|
66925
69934
|
enabled: true,
|
|
66926
69935
|
useMitt: true,
|
|
@@ -66957,7 +69966,7 @@ class MapManager {
|
|
|
66957
69966
|
this.searchMarkerManager = new SearchMarkerManager(this.map, defaultSearchConfig);
|
|
66958
69967
|
this.markerAdapter = new MarkerDrawingAdapter(this.map);
|
|
66959
69968
|
this.drawingManager = new DrawingManager({ map: this.map });
|
|
66960
|
-
this.measurementTool = new MeasurementTool(this.map);
|
|
69969
|
+
this.measurementTool = new MeasurementTool(this.map, this.storage);
|
|
66961
69970
|
const initialCenter = this.config.center || [116.404, 39.915];
|
|
66962
69971
|
const initialZoom = this.config.zoom || 10;
|
|
66963
69972
|
this.mapOperationTool = new MapOperationTool(this.map, initialCenter, initialZoom);
|
|
@@ -68018,16 +71027,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68018
71027
|
config: {},
|
|
68019
71028
|
width: { default: "100%" },
|
|
68020
71029
|
height: { default: "100%" },
|
|
68021
|
-
showToolbar: { type: Boolean, default:
|
|
68022
|
-
showMapInfo: { type: Boolean, default:
|
|
71030
|
+
showToolbar: { type: Boolean, default: void 0 },
|
|
71031
|
+
showMapInfo: { type: Boolean, default: void 0 },
|
|
68023
71032
|
loading: { type: Boolean, default: false },
|
|
68024
71033
|
userMarkers: {},
|
|
68025
71034
|
tooltipTemplate: {}
|
|
68026
71035
|
},
|
|
68027
|
-
emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-info", "tooltip-show", "tooltip-hide", "feature-click", "measurement-start", "measurement-end", "measurement-result", "context-menu", "tool-action", "search", "search-select", "search-clear", "fullscreen-toggle"],
|
|
71036
|
+
emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-info", "tooltip-show", "tooltip-hide", "feature-click", "measurement-start", "measurement-end", "measurement-result", "context-menu", "tool-action", "search", "search-select", "search-clear", "fullscreen-toggle", "plugin-event"],
|
|
68028
71037
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
68029
71038
|
const props = __props;
|
|
68030
71039
|
const emit = __emit;
|
|
71040
|
+
const eventBus = inject("eventBus");
|
|
71041
|
+
const storage = inject("storage");
|
|
68031
71042
|
const mapContainerRef = ref();
|
|
68032
71043
|
const contextMenuRef = ref();
|
|
68033
71044
|
const mapSearchRef = ref();
|
|
@@ -68040,6 +71051,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68040
71051
|
const currentZoom = ref(0);
|
|
68041
71052
|
const currentScale = ref("");
|
|
68042
71053
|
const contextMenuCoordinate = ref([0, 0]);
|
|
71054
|
+
ref();
|
|
68043
71055
|
const isCoordinatePicking = ref(false);
|
|
68044
71056
|
const coordinatePickCallback = ref(null);
|
|
68045
71057
|
const startCoordinatePick = (callback) => {
|
|
@@ -68070,6 +71082,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68070
71082
|
width: typeof props.width === "number" ? `${props.width}px` : props.width,
|
|
68071
71083
|
height: typeof props.height === "number" ? `${props.height}px` : props.height
|
|
68072
71084
|
}));
|
|
71085
|
+
const finalShowToolbar = computed(() => {
|
|
71086
|
+
var _a2;
|
|
71087
|
+
return props.showToolbar !== void 0 ? props.showToolbar : ((_a2 = props.config.ui) == null ? void 0 : _a2.showToolbar) ?? true;
|
|
71088
|
+
});
|
|
71089
|
+
const finalShowMapInfo = computed(() => {
|
|
71090
|
+
var _a2;
|
|
71091
|
+
return props.showMapInfo !== void 0 ? props.showMapInfo : ((_a2 = props.config.ui) == null ? void 0 : _a2.showMapInfo) ?? true;
|
|
71092
|
+
});
|
|
68073
71093
|
const tooltipConfig = computed(() => ({
|
|
68074
71094
|
enabled: true,
|
|
68075
71095
|
showCloseButton: true,
|
|
@@ -68141,7 +71161,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68141
71161
|
var _a2;
|
|
68142
71162
|
if (!mapContainerRef.value)
|
|
68143
71163
|
return;
|
|
68144
|
-
|
|
71164
|
+
if (!eventBus || !storage) {
|
|
71165
|
+
console.error("EventBus or Storage not provided");
|
|
71166
|
+
return;
|
|
71167
|
+
}
|
|
71168
|
+
mapManager = new MapManager(props.config, eventBus, storage);
|
|
68145
71169
|
map.value = mapManager.initMap(mapId.value);
|
|
68146
71170
|
bindMapEvents();
|
|
68147
71171
|
if (props.config.layers && props.config.layers.length > 0) {
|
|
@@ -68610,6 +71634,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68610
71634
|
__expose({
|
|
68611
71635
|
getMap: () => map.value,
|
|
68612
71636
|
getMapManager: () => mapManager,
|
|
71637
|
+
getPluginManager: () => pluginManager,
|
|
68613
71638
|
getEventManager: () => mapManager == null ? void 0 : mapManager.getEventManager(),
|
|
68614
71639
|
getSearchMarkerManager: () => mapManager == null ? void 0 : mapManager.getSearchMarkerManager(),
|
|
68615
71640
|
getMeasurementTool: () => mapManager == null ? void 0 : mapManager.getMeasurementTool(),
|
|
@@ -68656,7 +71681,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68656
71681
|
id: mapId.value,
|
|
68657
71682
|
class: "w-full h-full bg-gray-100"
|
|
68658
71683
|
}, null, 8, _hoisted_1$5),
|
|
68659
|
-
|
|
71684
|
+
finalShowToolbar.value ? (openBlock(), createBlock(MapToolbar, {
|
|
68660
71685
|
key: 0,
|
|
68661
71686
|
ref_key: "mapToolbarRef",
|
|
68662
71687
|
ref: mapToolbarRef,
|
|
@@ -68688,7 +71713,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68688
71713
|
]),
|
|
68689
71714
|
_: 3
|
|
68690
71715
|
}, 8, ["config", "position", "direction"])) : createCommentVNode("", true),
|
|
68691
|
-
|
|
71716
|
+
finalShowMapInfo.value ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
68692
71717
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "font-semibold text-white" }, "坐标:", -1)),
|
|
68693
71718
|
createElementVNode("div", _hoisted_3$5, toDisplayString(currentCoordinate.value), 1),
|
|
68694
71719
|
_cache[1] || (_cache[1] = createElementVNode("div", { class: "font-semibold text-white" }, "缩放:", -1)),
|
|
@@ -68782,7 +71807,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
68782
71807
|
};
|
|
68783
71808
|
}
|
|
68784
71809
|
});
|
|
68785
|
-
const MapContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
71810
|
+
const MapContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-5554afa9"]]);
|
|
68786
71811
|
const _hoisted_1$4 = { class: "flex items-center justify-between px-4 py-3 border-b border-gray-200 bg-gray-50 rounded-t-lg" };
|
|
68787
71812
|
const _hoisted_2$4 = { class: "panel-actions" };
|
|
68788
71813
|
const _hoisted_3$4 = { class: "panel-content max-h-125 overflow-y-auto" };
|
|
@@ -70324,7 +73349,7 @@ function createPopupManager(map, config) {
|
|
|
70324
73349
|
return new PopupManager(map, config);
|
|
70325
73350
|
}
|
|
70326
73351
|
const _hoisted_1 = {
|
|
70327
|
-
key:
|
|
73352
|
+
key: 8,
|
|
70328
73353
|
class: "absolute top-15 right-2.5 w-62.5 max-h-75 bg-white rounded-md shadow-lg z-1000 overflow-hidden md:w-50 md:top-20 md:right-1.25"
|
|
70329
73354
|
};
|
|
70330
73355
|
const _hoisted_2 = { class: "flex items-center justify-between px-4 py-3 border-b border-gray-200 bg-gray-50" };
|
|
@@ -70341,10 +73366,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70341
73366
|
config: {},
|
|
70342
73367
|
width: { default: "100%" },
|
|
70343
73368
|
height: { default: "100%" },
|
|
70344
|
-
showToolbar: { type: Boolean, default:
|
|
70345
|
-
showMapInfo: { type: Boolean, default:
|
|
70346
|
-
showLayerPanel: { type: Boolean, default:
|
|
70347
|
-
showLegend: { type: Boolean },
|
|
73369
|
+
showToolbar: { type: Boolean, default: void 0 },
|
|
73370
|
+
showMapInfo: { type: Boolean, default: void 0 },
|
|
73371
|
+
showLayerPanel: { type: Boolean, default: void 0 },
|
|
73372
|
+
showLegend: { type: Boolean, default: void 0 },
|
|
70348
73373
|
legendPosition: { default: "right" },
|
|
70349
73374
|
legendWidth: { default: 280 },
|
|
70350
73375
|
legendCollapsible: { type: Boolean, default: true },
|
|
@@ -70364,6 +73389,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70364
73389
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
70365
73390
|
const props = __props;
|
|
70366
73391
|
const emit = __emit;
|
|
73392
|
+
const instanceId = ref(`map-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`);
|
|
73393
|
+
const eventBus = ref(createLayerEventBus());
|
|
73394
|
+
const storage = ref(createMapStorage(instanceId.value));
|
|
73395
|
+
ref(null);
|
|
70367
73396
|
const mapContainerRef = ref();
|
|
70368
73397
|
const map = ref();
|
|
70369
73398
|
const loading = ref(false);
|
|
@@ -70373,11 +73402,58 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70373
73402
|
const configLoading = ref(false);
|
|
70374
73403
|
const showLayerPanel = ref(false);
|
|
70375
73404
|
const showPrintDialog = ref(false);
|
|
73405
|
+
const slots = useSlots();
|
|
73406
|
+
const hasToolbarSlot = computed(() => !!slots.toolbar);
|
|
73407
|
+
const hasMapInfoSlot = computed(() => !!slots.mapInfo || !!slots["map-info"]);
|
|
73408
|
+
const hasLayerPanelSlot = computed(() => !!slots.layerPanel || !!slots["layer-panel"]);
|
|
73409
|
+
const hasLegendSlot = computed(() => !!slots.legend);
|
|
73410
|
+
const finalShowToolbar = computed(() => {
|
|
73411
|
+
var _a2;
|
|
73412
|
+
if (hasToolbarSlot.value)
|
|
73413
|
+
return false;
|
|
73414
|
+
return props.showToolbar !== void 0 ? props.showToolbar : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.showToolbar) ?? true;
|
|
73415
|
+
});
|
|
73416
|
+
const finalShowMapInfo = computed(() => {
|
|
73417
|
+
var _a2;
|
|
73418
|
+
if (hasMapInfoSlot.value)
|
|
73419
|
+
return false;
|
|
73420
|
+
return props.showMapInfo !== void 0 ? props.showMapInfo : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.showMapInfo) ?? true;
|
|
73421
|
+
});
|
|
73422
|
+
const finalShowLayerPanel = computed(() => {
|
|
73423
|
+
var _a2;
|
|
73424
|
+
if (hasLayerPanelSlot.value)
|
|
73425
|
+
return false;
|
|
73426
|
+
return props.showLayerPanel !== void 0 ? props.showLayerPanel : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.showLayerPanel) ?? false;
|
|
73427
|
+
});
|
|
70376
73428
|
const showLegend = computed(() => {
|
|
70377
|
-
|
|
73429
|
+
var _a2;
|
|
73430
|
+
if (hasLegendSlot.value)
|
|
73431
|
+
return false;
|
|
73432
|
+
const finalShowLegend = props.showLegend !== void 0 ? props.showLegend : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.showLegend) ?? true;
|
|
73433
|
+
if (finalShowLegend === false)
|
|
70378
73434
|
return false;
|
|
70379
73435
|
return true;
|
|
70380
73436
|
});
|
|
73437
|
+
const finalLegendPosition = computed(() => {
|
|
73438
|
+
var _a2;
|
|
73439
|
+
return props.legendPosition || ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.legendPosition) || "right";
|
|
73440
|
+
});
|
|
73441
|
+
const finalLegendWidth = computed(() => {
|
|
73442
|
+
var _a2;
|
|
73443
|
+
return props.legendWidth || ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.legendWidth) || 280;
|
|
73444
|
+
});
|
|
73445
|
+
const finalLegendCollapsible = computed(() => {
|
|
73446
|
+
var _a2;
|
|
73447
|
+
return props.legendCollapsible !== void 0 ? props.legendCollapsible : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.legendCollapsible) ?? true;
|
|
73448
|
+
});
|
|
73449
|
+
const finalLegendDefaultCollapsed = computed(() => {
|
|
73450
|
+
var _a2;
|
|
73451
|
+
return props.legendDefaultCollapsed !== void 0 ? props.legendDefaultCollapsed : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.legendDefaultCollapsed) ?? false;
|
|
73452
|
+
});
|
|
73453
|
+
const finalLegendShowOnlyVisible = computed(() => {
|
|
73454
|
+
var _a2;
|
|
73455
|
+
return props.legendShowOnlyVisible !== void 0 ? props.legendShowOnlyVisible : ((_a2 = finalMapConfig.value.ui) == null ? void 0 : _a2.legendShowOnlyVisible) ?? true;
|
|
73456
|
+
});
|
|
70381
73457
|
const mapConfig = reactive({
|
|
70382
73458
|
center: [116.404, 39.915],
|
|
70383
73459
|
zoom: 10,
|
|
@@ -70456,7 +73532,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70456
73532
|
(newResults) => {
|
|
70457
73533
|
emit("measurement-change", newResults);
|
|
70458
73534
|
if (props.enableStorage) {
|
|
70459
|
-
|
|
73535
|
+
storage.value.saveMeasurements(newResults);
|
|
70460
73536
|
}
|
|
70461
73537
|
},
|
|
70462
73538
|
{ deep: true }
|
|
@@ -70498,7 +73574,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70498
73574
|
}
|
|
70499
73575
|
});
|
|
70500
73576
|
const loadStoredData = () => {
|
|
70501
|
-
const storedMeasurements =
|
|
73577
|
+
const storedMeasurements = storage.value.getMeasurements();
|
|
70502
73578
|
measurementResults.value = storedMeasurements;
|
|
70503
73579
|
};
|
|
70504
73580
|
const loadConfig = async () => {
|
|
@@ -70721,6 +73797,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70721
73797
|
};
|
|
70722
73798
|
provide("layerPanelConfig", layerPanelConfig);
|
|
70723
73799
|
provide("map", map);
|
|
73800
|
+
provide("eventBus", eventBus);
|
|
73801
|
+
provide("storage", storage);
|
|
73802
|
+
provide("instanceId", instanceId);
|
|
70724
73803
|
const toggleLayerPanel = () => {
|
|
70725
73804
|
showLayerPanel.value = !showLayerPanel.value;
|
|
70726
73805
|
};
|
|
@@ -70803,8 +73882,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70803
73882
|
config: finalMapConfig.value,
|
|
70804
73883
|
width: _ctx.width,
|
|
70805
73884
|
height: _ctx.height,
|
|
70806
|
-
"show-toolbar":
|
|
70807
|
-
"show-map-info":
|
|
73885
|
+
"show-toolbar": finalShowToolbar.value,
|
|
73886
|
+
"show-map-info": finalShowMapInfo.value,
|
|
70808
73887
|
loading: loading.value,
|
|
70809
73888
|
"tooltip-template": tooltipTemplate.value,
|
|
70810
73889
|
onMapReady,
|
|
@@ -70833,20 +73912,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70833
73912
|
]),
|
|
70834
73913
|
_: 3
|
|
70835
73914
|
}, 8, ["config", "width", "height", "show-toolbar", "show-map-info", "loading", "tooltip-template"]),
|
|
70836
|
-
|
|
70837
|
-
|
|
73915
|
+
hasToolbarSlot.value ? renderSlot(_ctx.$slots, "toolbar", { key: 0 }) : createCommentVNode("", true),
|
|
73916
|
+
hasMapInfoSlot.value ? renderSlot(_ctx.$slots, "mapInfo", { key: 1 }) : createCommentVNode("", true),
|
|
73917
|
+
hasMapInfoSlot.value ? renderSlot(_ctx.$slots, "map-info", { key: 2 }) : createCommentVNode("", true),
|
|
73918
|
+
finalShowLayerPanel.value ? (openBlock(), createBlock(LayerPanel, {
|
|
73919
|
+
key: 3,
|
|
70838
73920
|
visible: showLayerPanel.value,
|
|
70839
73921
|
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => showLayerPanel.value = $event),
|
|
70840
73922
|
onLayerChange
|
|
70841
73923
|
}, null, 8, ["visible"])) : createCommentVNode("", true),
|
|
73924
|
+
hasLayerPanelSlot.value ? renderSlot(_ctx.$slots, "layerPanel", { key: 4 }) : createCommentVNode("", true),
|
|
73925
|
+
hasLayerPanelSlot.value ? renderSlot(_ctx.$slots, "layer-panel", { key: 5 }) : createCommentVNode("", true),
|
|
70842
73926
|
showLegend.value ? (openBlock(), createBlock(LegendPanel, {
|
|
70843
|
-
key:
|
|
70844
|
-
position:
|
|
70845
|
-
width:
|
|
70846
|
-
collapsible:
|
|
70847
|
-
"default-collapsed":
|
|
70848
|
-
"show-only-visible":
|
|
73927
|
+
key: 6,
|
|
73928
|
+
position: finalLegendPosition.value,
|
|
73929
|
+
width: finalLegendWidth.value,
|
|
73930
|
+
collapsible: finalLegendCollapsible.value,
|
|
73931
|
+
"default-collapsed": finalLegendDefaultCollapsed.value,
|
|
73932
|
+
"show-only-visible": finalLegendShowOnlyVisible.value
|
|
70849
73933
|
}, null, 8, ["position", "width", "collapsible", "default-collapsed", "show-only-visible"])) : createCommentVNode("", true),
|
|
73934
|
+
hasLegendSlot.value ? renderSlot(_ctx.$slots, "legend", { key: 7 }) : createCommentVNode("", true),
|
|
70850
73935
|
measurementResults.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
70851
73936
|
createElementVNode("div", _hoisted_2, [
|
|
70852
73937
|
_cache[3] || (_cache[3] = createElementVNode("h4", { class: "m-0 text-sm font-semibold text-gray-800" }, "测量结果", -1)),
|
|
@@ -79172,7 +82257,7 @@ function(t2) {
|
|
|
79172
82257
|
*/
|
|
79173
82258
|
function(t2) {
|
|
79174
82259
|
function e2() {
|
|
79175
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
82260
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-9ab83315.mjs")).catch(function(t3) {
|
|
79176
82261
|
return Promise.reject(new Error("Could not load canvg: " + t3));
|
|
79177
82262
|
}).then(function(t3) {
|
|
79178
82263
|
return t3.default ? t3.default : t3;
|
|
@@ -88065,19 +91150,25 @@ export {
|
|
|
88065
91150
|
LineDrawingFactory as E,
|
|
88066
91151
|
PolygonDrawing as F,
|
|
88067
91152
|
PolygonDrawingFactory as G,
|
|
88068
|
-
|
|
91153
|
+
MultiPolygonDrawing as H,
|
|
88069
91154
|
IconDrawing as I,
|
|
88070
|
-
|
|
88071
|
-
|
|
91155
|
+
MultiPolygonDrawingFactory as J,
|
|
91156
|
+
MultiPointDrawing as K,
|
|
88072
91157
|
LayerManager as L,
|
|
88073
91158
|
MeasurementTool as M,
|
|
88074
|
-
|
|
88075
|
-
|
|
91159
|
+
MultiPointDrawingFactory as N,
|
|
91160
|
+
MultiLineStringDrawing as O,
|
|
88076
91161
|
PointDrawing as P,
|
|
88077
|
-
|
|
88078
|
-
|
|
88079
|
-
|
|
91162
|
+
MultiLineStringDrawingFactory as Q,
|
|
91163
|
+
ImageDrawing as R,
|
|
91164
|
+
ImageDrawingFactory as S,
|
|
88080
91165
|
TextDrawing as T,
|
|
91166
|
+
MilitaryDrawing as U,
|
|
91167
|
+
MilitaryDrawingFactory as V,
|
|
91168
|
+
DrawingManager as W,
|
|
91169
|
+
DrawingManagerFactory as X,
|
|
91170
|
+
MapOperationTool as Y,
|
|
91171
|
+
htmlToPDF as Z,
|
|
88081
91172
|
_typeof as _,
|
|
88082
91173
|
_sfc_main as a,
|
|
88083
91174
|
_sfc_main$m as b,
|