Skip to content
New issue

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

Map distance tool can't be disabled correctly if it has only draw starting vertex on map. #865

Closed
mirror-riddle opened this issue Feb 22, 2019 · 1 comment

Comments

@mirror-riddle
Copy link
Contributor

maptalks's version and what browser you use?

maptalks: 0.43.0
Chrome: 71.0.3578.98

Issue description

If you create map distance tool and only draw staring vertex on the map, then try to disable map distance tool, the brower console will print following error:

maptalks.min.js:6 Uncaught TypeError: Cannot read property 'code' of null
    at t.e._verifyProjection (VM11840 maptalks.min.js:6)
    at t.e.getContainerExtent (VM11840 maptalks.min.js:6)
    at n.t.getContainerExtent (VM11840 maptalks.min.js:6)
    at n.t.getSize (VM11840 maptalks.min.js:6)
    at t.e._msOnDrawEnd (VM11840 maptalks.min.js:6)
    at t.i._fire (VM11840 maptalks.min.js:6)
    at t.i.fire (VM11840 maptalks.min.js:6)
    at t.i._fireEvent (VM11840 maptalks.min.js:6)
    at t._fireEvent (VM11840 maptalks.min.js:6)
    at t.endDraw (VM11840 maptalks.min.js:6)

If you have draw more than one vertex on the map before disable distance tool, it would work fine.

Please provide a reproduction URL (on any jsfiddle like site)

maptalks distance tool bug demo

@fuzhenn
Copy link
Member

fuzhenn commented Feb 22, 2019

closed by #866

@fuzhenn fuzhenn closed this as completed Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants