c0e79425 by jikai

111111

1 parent 0527650f
......@@ -19,7 +19,6 @@ export default class flood {
this.positions2d.push(1000.0);
}
}
return positions;
});
}
initHyp() {
......
import objectManage from './maputils';
export default class heightControl {
constructor() {
this.handlerPolygon = new Cesium.DrawHandler(objectManage.viewer, Cesium.DrawMode.Polygon);
this.handlerPolygon.drawEvt.addEventListener(result => {
var array = [].concat(result.object.positions), positions = [];
var polygon = result.object;
if(!polygon) return;
polygon.show = false;
this.handlerPolygon.polyline.show = false;
for(var i = 0, len = array.length; i < len; i++){
var cartographic = Cesium.Cartographic.fromCartesian(array[i]);
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
if(positions.indexOf(longitude)===-1&&positions.indexOf(latitude)===-1){
positions.push(longitude);
positions.push(latitude);
}
}
this.polygon = objectManage.viewer.entities.add({
id: 'polygonA',
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray(positions),
height: 105,
material: new Cesium.Color(1, 1, 0.20, 0.5),
outline: true,
outlineColor: Cesium.Color.RED
}
}).polygon;
});
}
}
\ No newline at end of file
......@@ -41,6 +41,7 @@
</template>
<script>
import height from "../assets/js/map/heightControl";
export default {
name: 'tjxAnslysis',
components: {},
......@@ -49,16 +50,19 @@
src: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3820738330,1510784229&fm=26&gp=0.jpg'
}
},
mounted() {},
mounted() {
this.height instanceof height || (this.height = new height());
},
methods: {
closePop() {
this.$emit('closePop', 'tjxAnslysis')
},
startAnalysis() {
this.height.handlerPolygon.deactivate();
this.height.handlerPolygon.activate();
},
stopAnalysis() {
this.height.polygon.height = 50;
},
}
}
......
......@@ -127,6 +127,7 @@
// import flood from "../assets/js/map/flood";
// import viewpoint from "../assets/js/map/viewpoint";
// import visual from "../assets/js/map/visual";
import { loadModules } from "esri-loader";
import TopTitle from '../components/topTitle';
......@@ -194,6 +195,24 @@
}
},
mounted() {
// loadModules([
// "esri/Map",
// "esri/Basemap",
// "esri/views/MapView",
// "esri/layers/TileLayer",
// "esri/layers/WebTileLayer",
// // "dojo/domReady!"
// ]).then(([Map, Basemap, MapView, TileLayer, WebTileLayer]) => {
// // let configure = mapUrl[a],
// // args = { baseLayers: [] };
// // configure.layers.forEach(e => {
// // args.baseLayers.push(new WebTileLayer(e));
// // });
// // configure.url && (args.baseLayers.thumbnailUrl = configure.url);
// // this.map.basemap = new Basemap(args);
// });
this.viewer = new Cesium.Viewer('cesiumContainer', {shadows : true});
this.viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({
credit : new Cesium.Credit('天地图全球影像服务'),
......@@ -234,6 +253,7 @@
widget.showErrorPanel(title, undefined, e);
}
});
},
methods: {
searchRoat(val) {
......@@ -331,6 +351,7 @@
EtjxAnslysis(val) {
this[val] = !this[val];
this.onlySelect(val);
},
// 可视化分析
EvisualField(val) {
......@@ -346,6 +367,7 @@
EkgAnalusis(val) {
this[val] = !this[val];
this.onlySelect(val);
},
// 关闭pop方法
closePop(val) {
......