18f676bb by 刘远

Merge remote-tracking branch 'origin/master'

2 parents 18edbb69 3f79c517
......@@ -10,7 +10,7 @@ export default class createDraw {
}
distance() {
this.handlerDis.measureEvt.addEventListener(result => {
var dis = Number(result.distance), distance = dis > 1000 ? (dis / 1000).toFixed(2) + 'km' : dis.toFixed(2) + 'm';
var dis = Number(result.distance), distance = dis > 1000 ? (dis / 1000).toFixed(2) + 'km' : dis.toFixed(2) + 'm';
this.handlerDis.disLabel.text = '距离:' + distance;
});
this.handlerDis.activeEvt.addEventListener(this.handle());
......
......@@ -18,8 +18,7 @@ export default class flood {
this.positions2d.push(latitude);
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,
......@@ -236,22 +234,9 @@
widget.showErrorPanel(title, undefined, e);
}
});
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 '为地名地址道路的输入值'
......