| | |
| | | if (this.type && this.type == res) { |
| | | this.type = null |
| | | } |
| | | if (res.type == "zhaiHai") { |
| | | Viewer.dataSources.remove(Viewer.dataSources.getByName("zhaiHai2")[0]) |
| | | Viewer.dataSources.remove(Viewer.dataSources.getByName("zhaiHai1")[0]) |
| | | Viewer.dataSources.remove(Viewer.dataSources.getByName("zhaiHai3")[0]) |
| | | } else { |
| | | |
| | | if (!res.type) return; |
| | | Viewer.dataSources.remove(Viewer.dataSources.getByName(res.type)[0]) |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | addzhaiHaiGeoJson(res) { |
| | | var url1 = layerData.config.Model_URL + res.urls[0]; |
| | | var url2 = layerData.config.Model_URL + res.urls[1]; |
| | | var url3 = layerData.config.Model_URL + res.urls[2]; |
| | | var url1 = layerData.config.Model_URL + res.urls ; |
| | | |
| | | var color = Cesium.Color.fromCssColorString("rgb(255,0,255)") |
| | | var data1 = Cesium.GeoJsonDataSource.load(url1, //要加载的 url、GeoJSON 对象或 TopoJSON 对象。 |
| | | { |
| | |
| | | } |
| | | ) |
| | | data1.then((dataSource) => { |
| | | dataSource.name = "zhaiHai1" |
| | | dataSource.name = res.type |
| | | Viewer.dataSources.add( |
| | | dataSource |
| | | ); |
| | | }) |
| | | |
| | | var data2 = Cesium.GeoJsonDataSource.load(url2, //要加载的 url、GeoJSON 对象或 TopoJSON 对象。 |
| | | { |
| | | stroke: color, //折线和多边形轮廓的默认颜色。 |
| | | fill: Cesium.Color.WHITE.withAlpha(0.2), //多边形内部的默认颜色。 |
| | | strokeWidth: 3, //折线和多边形轮廓的默认宽度。 |
| | | } |
| | | ) |
| | | data2.then((dataSource) => { |
| | | dataSource.name = "zhaiHai2" |
| | | Viewer.dataSources.add( |
| | | dataSource |
| | | ); |
| | | }) |
| | | var data3 = Cesium.GeoJsonDataSource.load(url3, //要加载的 url、GeoJSON 对象或 TopoJSON 对象。 |
| | | { |
| | | stroke: color, //折线和多边形轮廓的默认颜色。 |
| | | fill: Cesium.Color.WHITE.withAlpha(0.2), //多边形内部的默认颜色。 |
| | | strokeWidth: 3, //折线和多边形轮廓的默认宽度。 |
| | | } |
| | | ) |
| | | data3.then((dataSource) => { |
| | | dataSource.name = "zhaiHai3" |
| | | Viewer.dataSources.add( |
| | | dataSource |
| | | ); |
| | | }) |
| | | |
| | | }, |
| | | |
| | | addZhongQuXianGeoJson(res) { |