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

_transformGeometries overrides matrix with null values

Open axelerate opened this issue 7 years ago • 2 comments

Whenever I rotate a shape, _transformGeometries executes this._path._transform(null); before this._transformPoints(this._path);, this yields exception Uncaught Error: Invalid LatLng object: (NaN, NaN) since the non existent matrix values recalculates the lat/lng values to NULL.

axelerate avatar Mar 15 '17 16:03 axelerate

Please provide a code example or jsfiddle, I don't know how to reproduce it

w8r avatar Mar 15 '17 16:03 w8r

The issue I encountered results from not setting up a max cap value for zoom level on the leaflet map. Inside of _getProjectedMatrix, the map.getMaxZoom() in line var zoom = map.getMaxZoom() || this.options.maxZoom; resolves to infinity on the latest version of Leaflet.js whenever maxZoom isn't defined, so the line itself will always be true. I suggest placing a case for Infinite values there as well.

axelerate avatar Mar 20 '17 18:03 axelerate