Commit fdefc12c by niuxiaolin

latest ui 08/09/2019 17:15:01

parent 85e30543
......@@ -136,65 +136,65 @@ export class MainComponent implements OnInit {
}
});
this.setBound();
this.dynamicScriptLoader.load('drawing').then(data => {
// Script Loaded Successfully
drawingManager.addEventListener('overlaycomplete', e => {
var overlay = e.overlay;
var coordinates = [];
if(overlay.getPath){
var path = overlay.getPath();
for (var i = 0; i < path.length; i++) {
coordinates.push([path[i].lng, path[i].lat]);
}
}else{
coordinates.push(overlay.getPosition())
}
if (overlay.toString() == '[object Polyline]') {
if (this.type == CordType.PROJ) {
this.proj.course = this.currentCouseId;
this.proj.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-1');
}
else if (this.type == CordType.COURSE) {
this.course.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-2');
}
else if (this.type == CordType.SECTION) {
this.section.project = this.currentProjId;
this.section.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-3');
}
}
else if (overlay.toString() == '[object Polygon]') {
// geojsonStr = {
// "type": "Polygon",
// "coordinates": [coordinates]
// };
}else if(overlay.toString() == "[object Marker]"){
this.marker.coordinate = JSON.stringify(coordinates[0]);
this.modalService.open('marker');
}
// document.getElementById('result').innerHTML = "<div><span>左下角,右上角(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + sw.lng + "," + sw.lat + "," + ne.lng + "," + ne.lat + "</p></div>"
// + "<div><span>左下角,右上角(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + swMc.x + "," + swMc.y + "," + neMc.x + "," + neMc.y + "</p></div>"
// + "<div><span>坐标集(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + pathStr + "</p></div>"
// + "<div><span>坐标集(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + pathmcStr + "</p></div>"
// + "<div><span>geojson:</span><button class='btn'>复制</button><p class='copyText' style='white-space:nowrap;'>" + JSON.stringify(geojsonStr) + "</p></div>";
});
}).catch(error => console.log(error));
this.route.queryParamMap.subscribe(queryParams => {
this.debug = Boolean(queryParams.get("debug"))
if (this.debug) {
this.dynamicScriptLoader.load('drawing').then(data => {
// Script Loaded Successfully
drawingManager.addEventListener('overlaycomplete', e => {
var overlay = e.overlay;
var coordinates = [];
if(overlay.getPath){
var path = overlay.getPath();
for (var i = 0; i < path.length; i++) {
coordinates.push([path[i].lng, path[i].lat]);
}
}else{
coordinates.push(overlay.getPosition())
}
if (overlay.toString() == '[object Polyline]') {
if (this.type == CordType.PROJ) {
this.proj.course = this.currentCouseId;
this.proj.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-1');
}
else if (this.type == CordType.COURSE) {
this.course.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-2');
}
else if (this.type == CordType.SECTION) {
this.section.project = this.currentProjId;
this.section.coordinate = JSON.stringify(coordinates);
this.modalService.open('custom-modal-3');
}
}
else if (overlay.toString() == '[object Polygon]') {
// geojsonStr = {
// "type": "Polygon",
// "coordinates": [coordinates]
// };
}else if(overlay.toString() == "[object Marker]"){
this.marker.coordinate = JSON.stringify(coordinates[0]);
this.modalService.open('marker');
}
// document.getElementById('result').innerHTML = "<div><span>左下角,右上角(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + sw.lng + "," + sw.lat + "," + ne.lng + "," + ne.lat + "</p></div>"
// + "<div><span>左下角,右上角(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + swMc.x + "," + swMc.y + "," + neMc.x + "," + neMc.y + "</p></div>"
// + "<div><span>坐标集(经纬度):</span><button class='btn'>复制</button><p class='copyText'>" + pathStr + "</p></div>"
// + "<div><span>坐标集(墨卡托坐标):</span><button class='btn'>复制</button><p class='copyText'>" + pathmcStr + "</p></div>"
// + "<div><span>geojson:</span><button class='btn'>复制</button><p class='copyText' style='white-space:nowrap;'>" + JSON.stringify(geojsonStr) + "</p></div>";
});
}).catch(error => console.log(error));
if(this.debug){
var node = document.getElementsByClassName('BMapLib_Drawing')[0];
(node as any).style.display = 'block';
}
})
......
......@@ -11494,11 +11494,11 @@ function httpGetAsync(theUrl, callback)
window.onmousewheel=function(e){
var curZoom = map.getZoom();
if(e.deltaY>0){
map.setZoom(curZoom-1);
}else{
map.setZoom(curZoom+1);
}
}
\ No newline at end of file
// window.onmousewheel=function(e){
// var curZoom = map.getZoom();
// if(e.deltaY>0){
// map.setZoom(curZoom-1);
// }else{
// map.setZoom(curZoom+1);
// }
// }
\ No newline at end of file
......@@ -266,7 +266,7 @@ body.jw-modal-open {
width: 4em;
line-break: strict;
white-space: initial;
margin-top:0.3em;
// margin-top:0.3em;
}
legend{
......@@ -280,3 +280,6 @@ legend{
font-size: 22px;
color:white;
}
.BMapLib_Drawing{
display: none;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment