cd-mapgis 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cd-mapgis",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "type": "module",
@@ -42,14 +42,15 @@ export default class MapDrawUtil {
42
42
  }
43
43
  //绘制完成事件
44
44
  drawend(fun, stop) {
45
+ let _this = this;
45
46
  this.drawObj.on('drawend', (e) => {
46
- this._drawTempLayer([e.feature]);
47
+ _this._drawTempLayer(e.feature);
47
48
  try {
48
49
  fun(e.feature.getGeometry().getCoordinates());//绘制完成后,将绘制的坐标串传入回调函数
49
50
  } catch (ex) {
50
51
  console.error(ex);
51
52
  }
52
- if (stop) this._closeDrawObj();
53
+ if (stop) _this._closeDrawObj();
53
54
  });
54
55
  }
55
56
  //关闭工具
@@ -103,7 +104,7 @@ export default class MapDrawUtil {
103
104
  });
104
105
  //绘制完成事件
105
106
  this.drawObj.on('drawend', function (e) {
106
- this._drawTempLayer([e.feature]);
107
+ _this._drawTempLayer(e.feature);
107
108
  _sketch = null;
108
109
  unByKey(_listener);
109
110
  });