nzjrs / osm-gps-map

A Gtk+ Widget for Displaying OpenStreetMap tiles LOOKING FOR A NEW MAINTAINER
http://nzjrs.github.com/osm-gps-map
GNU General Public License v2.0
135 stars 58 forks source link

ENHANCEMENT: do not download tiles that are not needed any more #90

Open paolobenve opened 3 years ago

paolobenve commented 3 years ago

If the zoom level is raised rapidly (mouse scroll) in the app using osm_gps, e.g. from 5 to 9, all the tiles needed tiles for zoom 6, then all those for zoom 7, then those for zoom 8, then those for zoom 9 are downloaded.

The same thing happens when lowering the zoom level, and when moving the map. A big amount of data is downloaded without a real need. This gives a serious "user experience" problem on slow connections.

My proposal is: if the zoom level changes while downloading a set of tiles, cancel the download of the zoom level not needed any more.

More generally: If a tile isn't needed any more, for changing the zoom level or for remaining outside the visible map window, stop downloading it.