18f676bb by 刘远

Merge remote-tracking branch 'origin/master'

2 parents 18edbb69 3f79c517
......@@ -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;
},
}
}
......
......@@ -147,8 +147,6 @@
const Cesium = window.Cesium;
import { loadModules } from 'esri-loader';
export default {
components: {
TopTitle,
......@@ -237,21 +235,8 @@
}
});
this.loadArcgis();
},
methods: {
loadArcgis() {
loadModules(['esri/views/MapView', 'esri/WebMap'])
.then(([MapView, WebMap]) => {
debugger
})
.catch(err => {
// handle any errors
console.error(err);
});
},
searchRoat(val) {
/**
* @param {*} val '为地名地址道路的输入值'
......