summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2023-03-22 21:45:28 +0100
committerMarcus Lundblad <ml@dfupdate.se>2023-03-25 15:19:12 +0100
commitb0d4fd66afca153e9b22edfbe11d7bb866957791 (patch)
treeb3ea3f02229074153f16e241782c36537327dadc
parentd7da5093ca6d682fdbebc0cfecaf1cd4a9138511 (diff)
downloadgnome-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.js13
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) {