tillnagel / unfolding

A library to create interactive maps and geovisualizations in Processing and Java
http://unfoldingmaps.org
Other
477 stars 245 forks source link

Map does not fit on the Screen. #183

Closed ventildeckeldichtung closed 2 years ago

ventildeckeldichtung commented 2 years ago

Hi, I hope someone can help me with this: I have an application that shows the World Map with some information on it. The map will display on a normal 1080p screen and the map should fill the entire screen. My problem is that with zoom level 3, the edges of the world map are missing. With zoom level 2, the map is already to small. Is there a way to make the zoom level deltas smaller? I simply want a complete world map that fills a 1080p screen and the user does not have to pan the map. Any other ideas are also welcome.

tillnagel commented 2 years ago

I see this more of a conceptual problem. The Mercator projection has a ratio of 1.65, while a Full HD screen has 1.77. Thus, it can never fit perfectly.

Have you tried to place the map in a way it fits all kind of expected areas, e.g. with

map.zoomTo(2.95f);
map.panTo(new Location(26.2, 5.2));
ventildeckeldichtung commented 2 years ago

Thank you so much. You fixed my problem I was not aware that you can pass a float value to the zoomTo() ethod. I was using the zoomAndPanTo method all with integer values all the thime.