We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this.drawingManager.addEventListener('overlaycancel', this.overlaycancel); this.drawingManager.addEventListener('overlaycomplete', this.overlaycomplete);
成功的回调正常,失败的没有触发
The text was updated successfully, but these errors were encountered:
只能改源码了,我修改了一些可以,具体是找到在源码里面找到'overlaycomplete',定位到i.prototype._dispatchOverlayComplete,然后再下面加上 // 给源码添加上取消的回调事件 i.prototype._dispatchOverlayCancel = function (m, n) { var l = { overlay: m, drawingMode: this._drawingType }; if (n) { l.calculate = n.data || null; l.label = n.label || null } this.dispatchEvent(this._drawingType + "cancel", m); this.dispatchEvent("overlaycancel", l); }; 再定位'_dispatchOverlayComplete'这个函数, 找到n._dispatchOverlayComplete(p),在其下面加上n._dispatchOverlayCancel(p) 再定位‘document.getElementById("cancelOperate")',在这个函数下面添加n.DrawingManager._dispatchOverlayCancel(l, r) 然后再调用的时候DrawingManager.addEventListener('overlaycancel', function (e) { console.log('取消',e.overlay) }) 就行了
Sorry, something went wrong.
No branches or pull requests
this.drawingManager.addEventListener('overlaycancel', this.overlaycancel);
this.drawingManager.addEventListener('overlaycomplete', this.overlaycomplete);
成功的回调正常,失败的没有触发
The text was updated successfully, but these errors were encountered: