mapsplotlib icon indicating copy to clipboard operation
mapsplotlib copied to clipboard

Zoom in and out

Open yashkotadia opened this issue 7 years ago • 5 comments

This is a feature request. Zooming in and out is essential to visualizing data on different scales. Is there a way to incorporate the same in mapsplotlib as well?

yashkotadia avatar Mar 07 '18 18:03 yashkotadia

Hi @yashkotadia,

Thanks for suggesting! In the current state, this package relies on the Google Static Maps API, which renders static images, on which the markers or other plots are drawn. So nothing very dynamic (at least yet)! Could you elaborate a bit more on how that would look like to you, for me to see if there's a good way to do it? Or maybe you have an idea in mind already? If there's an intuitive way to zoom in and out of the plot (never played with that), then we should be able to dynamically update the background map too.

Thanks!

tcassou avatar Mar 10 '18 10:03 tcassou

image

I don't have any idea about the implementation, however, the scale at the bottom right of the picture uploaded is what I am referring to.

yashkotadia avatar Mar 10 '18 16:03 yashkotadia

Thanks @yashkotadia for clarifying. Given the static aspect of the maps currently used, not sure it would be straightforward..! I'll see if I can think of something, also feel free to work on a PR if you have ideas!

tcassou avatar Mar 16 '18 22:03 tcassou

Hey @yashkotadia and @tcassou

I came across an idea while working on my project related to #12: Is it a viable option to specify a specific zoom by rounding down a zoom value and then cropping out the edges? For example, let's say you want zoom = 3.5, which can be achieved by setting the value zoom = 3 then cropping out the edges? I understand that the zoom value impacts the number of pixels in each longitude/latitude crossings.

ChakChak1234 avatar Sep 08 '18 12:09 ChakChak1234

Thanks for the suggestion! Not sure what this would look like, given the relatively poor default resolution. I think what @yashkotadia was suggesting is a dynamic way to zoom in/out (see picture), which is tricky with static maps/plots. This could be done with widgets in Jupyter, but it would not work outside it for example.

tcassou avatar Sep 10 '18 16:09 tcassou