Skip to content

Commit 46cd729

Browse files
committed
【fix】leaflet 升级部分源码改变导致UT没过; review by songym
1 parent a552191 commit 46cd729

File tree

4 files changed

+372
-360
lines changed

4 files changed

+372
-360
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"@babel/preset-env": "~7.19.4",
7474
"@babel/traverse": "~7.19.6",
7575
"@babel/types": "~7.19.4",
76-
"@geoman-io/leaflet-geoman-free": "^2.11.4",
76+
"@geoman-io/leaflet-geoman-free": "^2.14.2",
7777
"@supermap/babel-plugin-import": "^0.0.1",
7878
"babel-eslint": "^10.1.0",
7979
"babel-loader": "^8.1.0",

src/leaflet/components/ComponentsViewBase.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export var ComponentsViewBase = L.Control.extend({
8282
* @param {function} callback - 监听事件的回调函数。
8383
*/
8484
off(eventType, callback) {
85-
this._event.off(eventType, callback);
85+
if (callback) {
86+
this._event.off(eventType, callback);
87+
return;
88+
}
89+
this._event.off(eventType);
8690
},
8791

8892
/**

0 commit comments

Comments
 (0)