Closed laobubu closed 7 years ago
@fnicollet The readability is not as good as the original one, that's the fact.
However, in this version, the count of temporary objects is reduced, and their is no need to invoke extra methods like add()
, subtract()
and rotate()
. Everything is done in a single function.
Maybe adding some comments will help developers understand the algorithm.
Vector won't disappear when panning and zooming now. Repainting shall not be earlier than resizing canvas, or everything you just painted would be cleared.
Thanks a lot for your contribution !
Currently I'm working on a webapp based on OpenLayers, displaying in-door map. However OpenLayers is too heavy and I need a lightweight map library. The original Leaflet doesn't support rotation, and I found your mods which works like a charm. Thanks!
However, it doesn't support rotated markers yet, which OpenLayers supports. So I modified the code, adding
rotation
androtateWithView
options, andsetRotation(rad)
method for Marker.And BTW improved
L.Point.rotateFrom(theta, pivot)
's performance.Demo