jQuery-Mapael
jQuery-Mapael copied to clipboard
Zoom plots scaling
Fix #253
Implements a feature asked by several users: automatically scale down plots on zooming.
There are 2 hard parts in this feature:
- Handling of SVG plots, because they already have their own transforms...
- Handling of stroke-width when scaling (Raphael does not scale down the stroke-width when applying a transform). I had to introduce a special check in anim function to scale down stroke-width when we are zooming and scaling.
Plot scaling is disabled by default.
I've updated two examples to use plots scaling.
Wonderful new feature @Indigo744 !!
I have first checked the examples you provided. I think I have found a little error in the behavior in transformations_on_svg_plots.html by following this events :
1 / Zoom on the map 2 / Reset zoom level 3 / Click on "update elements" 4 / Re-zoom on the map
It seems that the SVG transform is lost when applying the last zoom.
Otherwise, it seems to work like a charm !
Damn... I though I had it working 🤦 I'll check it ASAP
I don't know why but I checked for a minimum zoom level before applying plot scaling. That should work now... 😃
Those SVG plots were real bitches! 🙄
There is actually a remaining bug that I should tackle... Wait for the update 😅
No problem, i'm waiting for it ;)
Damn, coming back to it several month after and I can't remember what was that bug...
Hi @Indigo744 ,
I will take the time to re-check your feature in all the possible ways as soon as possible. I hope we will find what was missing :)
Maybe it was related to this ?
I have still found another very little bug, but I don't know if it worth fixing it : if I zoom-in and hover a plot in the same time, it seems that the stroke-width is not properly update.
HI @Indigo744 ,
Sorry for my late answer. I ended up to take the time to re-check your great new feature, under Firefox and Chrome, and for my part, I didn't found anything else than the minor bug with the stroke width when zooming with the cursor on a plot !
Hello, i am still struggling to scale plots. Any help will be appriciated.