|
@@ -236,6 +236,7 @@
|
|
|
@toggle="toggleInfoTab"
|
|
|
@cluster="addClusterLayer"
|
|
|
@gowkt="goWkt"
|
|
|
+ @locationByGeojson="locationByGeojson"
|
|
|
@clear="clearMark"
|
|
|
:item="detailData"
|
|
|
></znxz-detail>
|
|
@@ -412,7 +413,7 @@ export default {
|
|
|
startTime: 0,
|
|
|
showIndentify: false,
|
|
|
detailData: null,
|
|
|
-
|
|
|
+ cyyqLayer: null,
|
|
|
legend: [
|
|
|
{
|
|
|
name: "可利用资源",
|
|
@@ -809,7 +810,7 @@ export default {
|
|
|
);
|
|
|
item.layer.setZIndex(item.zindex);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
this.map.addLayer(item.layer);
|
|
|
} else {
|
|
|
if (item.layer != undefined || item.layer != null) {
|
|
@@ -1051,12 +1052,26 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
that.geojsonLayer = geos.addTo(that.map);
|
|
|
- that.map.fitBounds(geos.getBounds(), { maxZoom: 17 });
|
|
|
+ that.map.fitBounds(geos.getBounds(), { padding: [200, 200] });
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// });
|
|
|
},
|
|
|
+ locationByGeojson(geojson, name) {
|
|
|
+ if (this.cyyqLayer) {
|
|
|
+ this.map.removeLayer(this.cyyqLayer);
|
|
|
+ this.cyyqLayer = null;
|
|
|
+ }
|
|
|
+ var layer = L.geoJSON(geojson, {
|
|
|
+ style: function (feature) {
|
|
|
+ return { color: "yellow", fillOpacity: 0 };
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.cyyqLayer = layer.addTo(this.map);
|
|
|
+ layer.bindPopup(name).openPopup();
|
|
|
+ this.map.fitBounds(layer.getBounds(), { padding: [200, 200] });
|
|
|
+ },
|
|
|
//获取地块信息
|
|
|
async getActiveItemGeometry(item) {
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -1174,6 +1189,10 @@ export default {
|
|
|
this.map.removeLayer(ele);
|
|
|
});
|
|
|
}
|
|
|
+ if (this.cyyqLayer) {
|
|
|
+ this.map.removeLayer(this.cyyqLayer);
|
|
|
+ this.cyyqLayer = null;
|
|
|
+ }
|
|
|
},
|
|
|
addClusterLayer(points) {
|
|
|
this.nearMarkerList.forEach((ele) => {
|