From 66977dbcd81410bca5feca281d61f6677a9ad543 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Wed, 22 Mar 2023 21:45:28 +0100 Subject: 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 --- src/mapWalker.js | 13 ++++++++++--- 1 file 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) { -- cgit v1.2.1