w8r / Leaflet.Path.Transform

Drag/rotate/resize handler for leaflet vector features.

Home Page:http://w8r.github.io/Leaflet.Path.Transform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

null _handleLine and _rotationMarker not handled properly

alcalin opened this issue · comments

In the example you have provided, if I disable 'rotate' and keep the rest on, I will get some errors in_.nScaleStart and _onScaleEnd

Util.js:59 Uncaught TypeError: Cannot read property '_leaflet_id' of null
    at stamp (Util.js:59)
    at NewClass.removeLayer (Layer.js:180)
    at NewClass._onScaleStart (L.Path.Transform.js:formatted:804)
    at NewClass.fire (Events.js:190)
    at NewClass._fireDOMEvent (Map.js:1433)
    at NewClass._handleDOMEvent (Map.js:1390)
    at HTMLDivElement.handler (DomEvent.js:79)
stamp @ Util.js:59
removeLayer @ Layer.js:180
_onScaleStart @ L.Path.Transform.js:formatted:804
fire @ Events.js:190
_fireDOMEvent @ Map.js:1433
_handleDOMEvent @ Map.js:1390
handler @ DomEvent.js:79
Layer.js:158 Uncaught TypeError: Cannot read property '_layerAdd' of null
    at NewClass.addLayer (Layer.js:158)
    at NewClass._onScaleEnd (L.Path.Transform.js:formatted:827)
    at NewClass.fire (Events.js:190)
    at NewClass._fireDOMEvent (Map.js:1433)
    at NewClass._handleDOMEvent (Map.js:1390)
    at HTMLDivElement.handler (DomEvent.js:79)

Seems that the this._handleLine and this._rotationMarker are null when rotation is disabled. Can anyone else confirm this ?

commented

I just ran into the same bug. I will enable rotation as a workaround now, thanks for the hint.