Leaflet.Path.Transform icon indicating copy to clipboard operation
Leaflet.Path.Transform copied to clipboard

Scaling stops working when setting rotation to false

Open carlosgarciamar opened this issue 7 years ago • 2 comments

After setting rotation to false (polygon.transform.enable({rotation: false, scaling: true});) I start receiving the following error every time I try to scale the polygon:

leaflet-src.js:72

Uncaught TypeError: Cannot read property '_leaflet_id' of null at stamp (leaflet-src.js:72) at NewClass.removeLayer (leaflet-src.js:6557) at NewClass._onScaleStart (Path.Transform.js:612) at NewClass.fire (leaflet-src.js:593) at NewClass._fireDOMEvent (leaflet-src.js:4342) at NewClass._handleDOMEvent (leaflet-src.js:4299) at HTMLDivElement.handler (leaflet-src.js:2280)

It works perfectly if I just enable transform without passing any options (polygon.transform.enable();), any idea why?

Thanks,

Carlos

carlosgarciamar avatar Jan 24 '18 17:01 carlosgarciamar

Can't reproduce, which version is it?

w8r avatar Nov 27 '18 18:11 w8r

I have the same issue. Did not check but maybe problem is in _createHandlers function (around 476 line)

if (this.options.scaling) { this._handlers = [];

handlers are set to be empty if there is scaling set as true. For rotation I can see push only without settings handlers as an empty array

aczopekkontaktio avatar Jul 22 '19 12:07 aczopekkontaktio