|
@@ -94,6 +94,7 @@ class AuthenticMap {
|
|
|
}
|
|
|
|
|
|
initMap(location, target) {
|
|
|
+ let that = this
|
|
|
let level = 16;
|
|
|
let coordinate = util.wktCastGeom(location).getFirstCoordinate();
|
|
|
this.kmap = new KMap.Map(
|
|
@@ -112,22 +113,24 @@ class AuthenticMap {
|
|
|
}
|
|
|
});
|
|
|
this.kmap.modifyDraw((e) => {
|
|
|
- if(e.type === "pointerdown"){
|
|
|
+ if(e.type === "modifyend"){
|
|
|
+ mapData.isEditArea = false;
|
|
|
+ mapData.isEditArea = true;
|
|
|
+ }
|
|
|
+ }, function(e){
|
|
|
let f = null
|
|
|
- this.kmap.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
|
|
|
+ that.kmap.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
|
|
|
f= feature
|
|
|
- });
|
|
|
+ },{hitTolerance:10});
|
|
|
+ if(!f){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ console.log(f)
|
|
|
let res = f.get("id") === mapData.curPointData.id || !f.get("id")
|
|
|
if(!res){
|
|
|
ElMessage.warning("编辑中")
|
|
|
}
|
|
|
return res
|
|
|
- }
|
|
|
-
|
|
|
- if(e.type === "modifyend"){
|
|
|
- mapData.isEditArea = false;
|
|
|
- mapData.isEditArea = true;
|
|
|
- }
|
|
|
});
|
|
|
this.kmap.addLayer(this.clickPointLayer.layer);
|
|
|
this.kmap.addLayer(this.locationLayer.layer);
|