|
|
@@ -110,6 +110,7 @@ export default { |
|
|
|
}); |
|
|
|
//图层查询定位开始 ---------start |
|
|
|
if(this.message.substring(0,1) =="{"){ |
|
|
|
//that.newHt ="1"; |
|
|
|
// var theGeomMap =this.message.replace("Point", "MultiPolygon"); |
|
|
|
// var pointLeft = theGeomMap.replace("[", "[[[["); |
|
|
|
// var pointRight = pointLeft.replace("]", "]]]]"); |
|
|
@@ -151,11 +152,11 @@ export default { |
|
|
|
// map.getView().fit([maxXMap, maxYMap, minXMap, minYMap]); |
|
|
|
// map.getView().setResolution(resolution); |
|
|
|
} else if(this.message.substring(0,1) =="["){ |
|
|
|
//that.newHt ="1"; |
|
|
|
var zbNew = JSON.stringify({"type": "MultiPolygon", "coordinates": [this.message.replaceAll("\"","")]}); |
|
|
|
var leftJoin = zbNew.replace("\"[","["); |
|
|
|
var rightJoin = leftJoin.replace("\"]","]"); |
|
|
|
console.log(rightJoin); |
|
|
|
hc_landFuther = new ol.layer.Vector({ |
|
|
|
hc_land = new ol.layer.Vector({ |
|
|
|
title: "add Layer", |
|
|
|
source: new ol.source.Vector({ |
|
|
|
projection: projection, |
|
|
@@ -175,11 +176,11 @@ export default { |
|
|
|
}), |
|
|
|
}), |
|
|
|
}); |
|
|
|
map.addLayer(hc_landFuther); |
|
|
|
var maxXMap = hc_landFuther.values_.source.featuresRtree_.rbush_.data.maxX; |
|
|
|
var maxYMap = hc_landFuther.values_.source.featuresRtree_.rbush_.data.maxY; |
|
|
|
var minXMap = hc_landFuther.values_.source.featuresRtree_.rbush_.data.minX; |
|
|
|
var minYMap = hc_landFuther.values_.source.featuresRtree_.rbush_.data.minY; |
|
|
|
map.addLayer(hc_land); |
|
|
|
var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX; |
|
|
|
var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY; |
|
|
|
var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX; |
|
|
|
var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY; |
|
|
|
//定位查询位置 |
|
|
|
var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置 |
|
|
|
map.getView().animate({ |
|
|
@@ -199,7 +200,6 @@ export default { |
|
|
|
//开始绘制地图 |
|
|
|
$("#"+this.drawingPolygonMap).click(function () { |
|
|
|
map.removeLayer(hc_land); |
|
|
|
map.removeLayer(hc_landFuther); |
|
|
|
map.removeLayer(vector_drawing); |
|
|
|
//that.closeMoule = null; |
|
|
|
map.removeInteraction(draw); |
|
|
@@ -239,14 +239,9 @@ export default { |
|
|
|
//还原之前图层 |
|
|
|
$("#"+this.drawingResetMap).click(function () { |
|
|
|
if(that.closeMoule !=null) { |
|
|
|
if(that.message.substring(0,1) =="{"){ |
|
|
|
map.addLayer(hc_landFuther); |
|
|
|
} |
|
|
|
if(that.message.substring(0,1) =="["){ |
|
|
|
map.addLayer(hc_land); |
|
|
|
map.removeInteraction(draw); |
|
|
|
map.removeLayer(vector_drawing); |
|
|
|
} |
|
|
|
that.formSubmit(); |
|
|
|
} |
|
|
|
}); |
|
|
|