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 11:55:32 +0100
commit66977dbcd81410bca5feca281d61f6677a9ad543 (patch)
treed1a88c3a255bce03eafe702ded266350f1320dbd
parentb968f996f54d30e5fb1271db3b47bb9ae6f98b31 (diff)
downloadgnome-maps-66977dbcd81410bca5feca281d61f6677a9ad543.tar.gz
mapWalker: Disable animation on zoomToFit()wip/mlundblad/zoom-to-fit-disable-animation
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) {