diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2023-03-22 21:45:28 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2023-03-25 15:19:12 +0100 |
commit | b0d4fd66afca153e9b22edfbe11d7bb866957791 (patch) | |
tree | b3ea3f02229074153f16e241782c36537327dadc | |
parent | d7da5093ca6d682fdbebc0cfecaf1cd4a9138511 (diff) | |
download | gnome-maps-b0d4fd66afca153e9b22edfbe11d7bb866957791.tar.gz |
mapWalker: Disable animation on zoomToFit()
To prevent getting throttled by the tile server (HTTP 429),
as a workaround for now disable the animation.
https://gitlab.gnome.org/GNOME/gnome-maps/-/issues/546
-rw-r--r-- | src/mapWalker.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mapWalker.js b/src/mapWalker.js index 76a6ffbf..09195f8e 100644 --- a/src/mapWalker.js +++ b/src/mapWalker.js @@ -83,9 +83,16 @@ export class MapWalker extends GObject.Object { zoomToFit() { let zoom = this._getZoomLevel(); - this._mapView.map.go_to_full(this.place.location.latitude, - this.place.location.longitude, - zoom); + /* + * WORKAROUND!!!! + * + * For now disable the animation to prevent getting + * throttled by the tile server: + * https://gitlab.gnome.org/GNOME/gnome-maps/-/issues/546 + */ + this._mapView.map.center_on(this.place.location.latitude, + this.place.location.longitude); + this._mapView.map.viewport.zoom_level = zoom; } goTo(animate, linear) { |