| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2024-10-31 10:47:29 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2024-12-06 16:13:43 |
| | | * @LastEditTime: 2024-12-09 11:52:35 |
| | | * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue |
| | | * @Description: |
| | | * |
| | |
| | | let addTileLayers = {} |
| | | let tileLayers = new DC.TilesetLayer('tileLayers') |
| | | window.$viewer.addLayer(tileLayers) |
| | | |
| | | let planToBuild = new DC.HtmlLayer('planToBuild') |
| | | window.$viewer.addLayer(planToBuild) |
| | | |
| | | const { |
| | | show: showLayerControl |
| | |
| | | |
| | | if (i.properties.RefName.indexOf('拟建') != -1) { |
| | | polylineVolume.setStyle({ |
| | | material: DC.Color.fromBytes(234, 93, 240, 230) |
| | | material: DC.Color.fromBytes(255, 0, 0, 230) |
| | | }) |
| | | |
| | | let features = window.$turf.featureCollection( |
| | | i.geometry.coordinates.map(d => window.$turf.point([d[0], d[1]])) |
| | | ) |
| | | |
| | | let planCenter = window.$turf.center(features) |
| | | |
| | | let planDivIcon = new DC.DivIcon( |
| | | new DC.Position(planCenter.geometry.coordinates[0], planCenter.geometry.coordinates[1], 60.5), |
| | | `<div class="public-map-popup"> |
| | | <div class="map-name">拟建</div> |
| | | <div class="map-icon"> |
| | | <img src="${VITE_APP_BASE + 'img/mapicon/nj-ys.png'}"> |
| | | </div> |
| | | </div>` |
| | | ) |
| | | |
| | | planToBuild.addOverlay(planDivIcon) |
| | | } else { |
| | | polylineVolume.setStyle({ |
| | | material: item.color |
| | |
| | | window.$viewer && window.$viewer.removeLayer(addTileLayers[item.layerName]) |
| | | addTileLayers[item.layerName] = null |
| | | delete addTileLayers[item.layerName] |
| | | |
| | | if (item.layerName == 'ysgw' && planToBuild) { |
| | | planToBuild.clear() |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | window.$viewer && window.$viewer.removeLayer(tileLayers) |
| | | tileLayers = null |
| | | } |
| | | |
| | | if (planToBuild) { |
| | | planToBuild.remove() |
| | | window.$viewer && window.$viewer.removeLayer(planToBuild) |
| | | planToBuild = null |
| | | } |
| | | |
| | | // 弹窗销毁 |
| | | destroyPop() |
| | | addPopLayers = null |