|
@@ -185,6 +185,7 @@ export default {
|
|
|
},
|
|
|
goLayer(geom, lid) {
|
|
|
if (tdsy.layer) tdsy.layer.show = false;
|
|
|
+ // tdsy.removelayer();
|
|
|
let layer = viewer.imageryLayers.addImageryProvider(
|
|
|
new Cesium.SuperMapImageryProvider({
|
|
|
url: this.layersData.url,
|
|
@@ -194,18 +195,25 @@ export default {
|
|
|
tdsy.layersObj[lid] = layer;
|
|
|
this.loadGeoJSON(geom, lid);
|
|
|
},
|
|
|
- loadGeoJSON(geojson, id) {
|
|
|
+ loadGeoJSON(geojson, id, yanse, isfly = true) {
|
|
|
let polygon = Cesium.GeoJsonDataSource.load(geojson, {
|
|
|
clampToGround: true,
|
|
|
- stroke: Cesium.Color.RED.withAlpha(0),
|
|
|
- fill: Cesium.Color.WHITE.withAlpha(0),
|
|
|
+ stroke: yanse
|
|
|
+ ? Cesium.Color.fromCssColorString(yanse)
|
|
|
+ : Cesium.Color.RED.withAlpha(0),
|
|
|
+ fill: yanse
|
|
|
+ ? Cesium.Color.fromCssColorString(yanse).withAlpha(0.3)
|
|
|
+ : Cesium.Color.WHITE.withAlpha(0),
|
|
|
+ strokeWidth: isfly ? 5 : 2,
|
|
|
+ zIndex: isfly ? 10 : 5,
|
|
|
});
|
|
|
polygon.then(function (dataSource) {
|
|
|
viewer.dataSources.add(dataSource);
|
|
|
layerSources[id] = dataSource;
|
|
|
- viewer.flyTo(dataSource, {
|
|
|
- offset: new Cesium.HeadingPitchRange(0, -45),
|
|
|
- });
|
|
|
+ if (isfly)
|
|
|
+ viewer.flyTo(dataSource, {
|
|
|
+ offset: new Cesium.HeadingPitchRange(0, -45),
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
multiPolygonToPolygons(multiPolygon) {
|
|
@@ -361,7 +369,11 @@ export default {
|
|
|
} else {
|
|
|
if (this.cockpit_vector.mapType) {
|
|
|
this.setLayerStatus(item);
|
|
|
- } else this.addpolygon(item);
|
|
|
+ } else {
|
|
|
+ // this.addpolygon(item);
|
|
|
+ this.tempdataLayerId = "h_" + item.index;
|
|
|
+ this.loadGeoJSON(item.geom, "h_" + item.index, "#ff0000");
|
|
|
+ }
|
|
|
}
|
|
|
store.setVectordataid(item.dataid);
|
|
|
let arr = [];
|
|
@@ -579,7 +591,13 @@ export default {
|
|
|
active_dableData(newVal, oldVal) {
|
|
|
if (this.cockpit_vector.mapType)
|
|
|
this.draw_vector_server(this.cockpit_vector.mapType);
|
|
|
- else this.draw_vector_tdgy_gy_jd(newVal);
|
|
|
+ // else this.draw_vector_tdgy_gy_jd(newVal);
|
|
|
+ else {
|
|
|
+ newVal.forEach((res, index) => {
|
|
|
+ res.index = index;
|
|
|
+ if (res.geom) this.loadGeoJSON(res.geom, index, "#55A1E3", false);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
tempdataLayerId(newVal, oldVal) {
|
|
|
if (oldVal && tdsy.layersObj[oldVal]) {
|
|
@@ -587,6 +605,10 @@ export default {
|
|
|
} else if (tdsy.layersObj[newVal]) {
|
|
|
// tdsy.layersObj[newVal].show = true;
|
|
|
}
|
|
|
+ if (oldVal && layerSources[oldVal]) {
|
|
|
+ viewer.dataSources.remove(layerSources[oldVal]);
|
|
|
+ layerSources[oldVal] = null;
|
|
|
+ }
|
|
|
console.log(newVal, oldVal, "----");
|
|
|
},
|
|
|
computed_vectorData(newVal, oldVal) {
|
|
@@ -693,9 +715,9 @@ div::-webkit-scrollbar {
|
|
|
line-height: 23px;
|
|
|
padding: 0 5px;
|
|
|
border-radius: 4px;
|
|
|
- top: -1.9rem !important;
|
|
|
- position: relative;
|
|
|
- right: -24rem;
|
|
|
+ top: 10px !important;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
}
|
|
|
|
|
|
.PangetitleVector {
|
|
@@ -707,7 +729,7 @@ div::-webkit-scrollbar {
|
|
|
line-height: 35px;
|
|
|
font-size: 14px;
|
|
|
padding-left: 15px;
|
|
|
- display: flex;
|
|
|
+ // display: flex;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
}
|