biolab / orange3-geo

:tangerine: :earth_africa: Orange add-on for dealing with geography and geo-location
GNU General Public License v3.0
25 stars 28 forks source link

Smooth zoom in Map and Choropleth #164

Closed janezd closed 1 year ago

janezd commented 1 year ago
Actual behavior

Zoom in Map and Choropleth uses discrete jumps, supposedly following the tile sizes by map provider. This makes them difficult (well, annoying) to use.

Expected behavior

Make it smooth.

For bonus points: support native gestures (https://doc.qt.io/qt-5/qt.html#NativeGestureType-enum)

Geo version, Orange version

Any.

janezd commented 1 year ago

Answering to self: I'm smarter now than I was 5 hours ago. I now recall (hopefully correctly) that @robertcv fixed zoom levels because of @BlazZupan complained about bad rendering of map labels. I naively thought that requesting tiles at higher zoom and scaling them down would do the trick, but obviously doesn't because higher zoom also means more labels, which are then too small to read. Moreover, I thought that sites with smooth zoom (e.g. Komoot) do it this way, but now I realize they must use vector tiles. How to use vector tiles in PyQt - I've no idea.

robertcv commented 1 year ago

You summed it up pretty well. For the best image quality with raster tiles, you must match the display resolution with the tile resolution. Any scaling will make it worse. The current approach is the same as how https://leafletjs.com/, https://www.openstreetmap.org/ and https://maps.google.com/ do it and I think those look and feel just fine. The one thing that Orange lacks compared to them is a good transition animation between zoom levels. Maybe tweaking this would be the best first step. If I remember correctly currently the last layer is scaled with PyQt and then tiles from the new layer are slowly loaded in over it. Back then I didn't really think too hard about it so sure there is a better way to do it.