Open daynin opened 8 years ago
Hi!
If you mean having the same pattern look not depending on the map zoom, you have to define the pattern repeat
property in pixels. See the line under "Pattern definition" in the README.
In your example, I guess you've defined it in percents, so their number is constant and the decorator have to shrink or enlarge spaces between them to cover the full line.
If you meant changing the size of the symbols themselves depending on the zoom, like in your example keeping the same number of arrows, the arrow heads in the same relative position, and changing the arrow line size, it's a bit more difficult. Your arrows are markers, and Leaflet markers don't scale with zoom.
You would have to define a new pattern type drawn with vector overlays (Polyline, Polygon, etc.). You can use L.Symbol.ArrowHead
as an inspiration. Let me know if there are missing pieces to do it. Maybe I'll do it on my side too.
Hello, First, thanks for this great plug-in ! This is a feature that is very useful. Arrows look great but once the zoom is activated, they become either too big or too small. At the moment, my workaround is to modify the pixel size every time there is a zoomend event, but it really is not a great solution. I'm not talented enough to create a new pattern type as suggested but would very much like to be kept in the loop of any developments Thanks
Hi @JoceM! Do you have screenshots of the result, or better a working example of your workaround, so I can see more explicitely what features are missing? It would definitely help, as it's not always easy to see what everybody means by "too big" or "too small" :) Thanks
Hi @bbecquet
Thanks for your reply. I have attached 2 print screens that hopefully make my point clearer.
The first one is titled "Flèches Europe" and shows a "reasonable" arrow size. The second one is a focus on one polyline. The arrow remained at the same "pixelSize" but look now far too big. My idea is to find an option to show the arrow at the same size no matter what the zoom level is. In other words, ideally, the "Flèches details" should show an arrow that has a same size as in Flèches Europe.
Does it clarify ?
@JoceM Did you ever resolve the autoscaling issue? I am facing the same problem now.
Hello.
For example, I want to add pattern which will scale depending on map zoom.
Without it when I change zoom of a map, it looks like this:
Is there some way to change a scale of a pattern (or size)?