|
@@ -363,6 +363,11 @@ class Map {
|
|
|
let features = vm.polygonLayer.source.getFeatures()
|
|
|
return features
|
|
|
}
|
|
|
+ getFeatureById(id) {
|
|
|
+ const vm = this
|
|
|
+ let feature = vm.polygonLayer.source.getFeatureById(id)
|
|
|
+ return feature
|
|
|
+ }
|
|
|
|
|
|
// 传入geojson,回显到polygon
|
|
|
setLayerPolygon(geometry) {
|
|
@@ -373,6 +378,9 @@ class Map {
|
|
|
setLayerWkt(wkt,data,isView, padding) {
|
|
|
const vm = this
|
|
|
let f = new Feature({geometry:new WKT().readGeometry(wkt),...data})
|
|
|
+ if(f.get("id")){
|
|
|
+ f.setId(f.get("id"))
|
|
|
+ }
|
|
|
const extent = f.getGeometry().getExtent()
|
|
|
vm.polygonLayer.source.addFeature(f)
|
|
|
if(isView){
|