Browse Source

修复地图元素改名/改颜色BUG

李富豪 1 year ago
parent
commit
503c274b4e
1 changed files with 4 additions and 12 deletions
  1. 4 12
      Web/src/pages/page-web/projects/layer/index.vue

+ 4 - 12
Web/src/pages/page-web/projects/layer/index.vue

@@ -272,18 +272,6 @@ function setBaseInfo() {
     layerState.user_name = layer.resource?.user_name;
     layerState.user_name = layer.resource?.user_name;
     layerState.element_from = layer.element_from;
     layerState.element_from = layer.element_from;
     layerState.height = layer.height
     layerState.height = layer.height
-    let coordinate: GeojsonCoordinate
-    switch (geoType) {
-      case GeoType.Point:
-        coordinate = gcj02towgs84(layer.resource?.content.geometry.coordinates[0], layer.resource?.content.geometry.coordinates[1]) as GeojsonCoordinate
-        layerState.longitude = coordinate[0]
-        layerState.latitude = coordinate[1]
-        break
-      case GeoType.LineString:
-        break
-      case GeoType.Polygon:
-        break
-    }
   }
   }
 }
 }
 
 
@@ -378,6 +366,10 @@ async function updateElements() {
   const currentLayer = selectedLayer.value
   const currentLayer = selectedLayer.value
   content = currentLayer.resource.content
   content = currentLayer.resource.content
   content.properties.color = layerState.color
   content.properties.color = layerState.color
+  // 移除标点
+  useGMapCoverHook.removeCoverFromMap(currentLayer.id)
+  // 移除文本覆盖物
+  useGMapCoverHook.removeCoverFromMap(currentLayer.id + '_text')
   updateMapElement(selectedLayer.value, layerState.layerName, layerState.color)
   updateMapElement(selectedLayer.value, layerState.layerName, layerState.color)
   const result = await updateElementsReq(layerState.layerId, {
   const result = await updateElementsReq(layerState.layerId, {
     name: layerState.layerName,
     name: layerState.layerName,