jQuery-Mapael icon indicating copy to clipboard operation
jQuery-Mapael copied to clipboard

Zoom plots scaling

Open Indigo744 opened this issue 8 years ago • 10 comments
trafficstars

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.

Indigo744 avatar Nov 09 '17 21:11 Indigo744

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 !

neveldo avatar Nov 11 '17 20:11 neveldo

Damn... I though I had it working 🤦‍ I'll check it ASAP

Indigo744 avatar Nov 11 '17 22:11 Indigo744

I don't know why but I checked for a minimum zoom level before applying plot scaling. That should work now... 😃

Indigo744 avatar Nov 11 '17 22:11 Indigo744

Those SVG plots were real bitches! 🙄

Indigo744 avatar Nov 11 '17 22:11 Indigo744

There is actually a remaining bug that I should tackle... Wait for the update 😅

Indigo744 avatar Nov 12 '17 19:11 Indigo744

No problem, i'm waiting for it ;)

neveldo avatar Nov 12 '17 21:11 neveldo

Damn, coming back to it several month after and I can't remember what was that bug...

Indigo744 avatar Apr 08 '18 17:04 Indigo744

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.

neveldo avatar Apr 09 '18 07:04 neveldo

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 !

neveldo avatar Apr 21 '18 22:04 neveldo

Hello, i am still struggling to scale plots. Any help will be appriciated.

SarikaWirtz avatar Feb 11 '21 10:02 SarikaWirtz