pasichnykvasyl / Leaflet.BigImage

A leaflet plugin that allows users to receive a large map area and download it.
https://pasichnykvasyl.github.io/Leaflet.BigImage/
MIT License
80 stars 27 forks source link

Work in reverse/opposite feature? #8

Open drElektron opened 3 years ago

drElektron commented 3 years ago

Great plugin, I've enjoyed playing with it with OSM tiles. As good as it is it strikes me that it works in a way that is not completely intuitive and is perhaps a little inconsistent with the description:

...plugin that allows users to download an image with a scaled-up version of the visible map.

Sorry this might be a little rambling and incoherent, please bear with me.

The distinction is between something that is "scaled" versus something that is "expanded". I guess the complication here is that "scale" in the context of a map has a more complicated meaning than simply "to multiply".

Currently the plugin seems to expand the displayed map and return a map at the same scale (zoom level) multiplied by the defined "scale" (should maybe read scaling) factor. e.g, for a map with dimensions 600px by 400px, zoom level 13 and scale factor set to 2 returns a PNG of 1200px by 800px at the same zoom level. This means that users are defining a scale/zoom-level and getting back a static map with bounds they have not defined.

I would suggest that many users are in the reverse position - they know what geographic boundary they want their static map to have and then want to be able to download a more detailed "scaled up" version of it. e.g, a user has a map view (600px by 400px) at zoom level 13, which I think covers an area that is ~11.5km by 7.6km. However, the user wants this same geographic area in more detail (i.e "scaled up"). If I want 2x the scale then this could be a 1200px by 800px PNG at zoom level 14. According to the OSM docs zoom level 13 (1:70,000) is twice the scale of zoom level 14 (1:35,000) So both images would cover the same area (~11.5km by 7.6km), but one would have twice the size and twice the scale/zoom.

I hope that makes sense. It's a great plugin and I think if it had the option to work as described above then it could be even more useful.

pasichnykvasyl commented 3 years ago

@drElektron , thanks for your feedback

Sure, your description looks more logical and correct. I'll try to do as you described.