summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Danielsson <jonas@threetimestwo.org>2015-10-10 23:46:12 +0200
committerJonas Danielsson <jonas@threetimestwo.org>2015-10-10 23:54:16 +0200
commitd5b807d914e42315cd2bac1f790d5c951b79f82a (patch)
treee70a7d637522b2e3a4cc3189e68f4ccd45a8f3d7
parent268627936e0fa0bd1bba94ab193c61133544c5e8 (diff)
downloadgnome-maps-d5b807d914e42315cd2bac1f790d5c951b79f82a.tar.gz
Improve zoom travel
-rw-r--r--src/mapMarker.js6
-rw-r--r--src/mapWalker.js3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mapMarker.js b/src/mapMarker.js
index e31290f0..92cc4e95 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -70,8 +70,10 @@ const MapMarker = new Lang.Class({
_onButtonPress: function(marker, event) {
// Zoom in on marker on double-click
if (event.get_click_count() > 1) {
- this._view.zoom_level = this._view.max_zoom_level - 1;
- this._view.center_on(this.latitude, this.longitude);
+ if (this._view.zoom_level < this._view.max_zoom_level - 1) {
+ this._view.zoom_level = this._view.max_zoom_level - 1;
+ this._view.center_on(this.latitude, this.longitude);
+ }
}
},
diff --git a/src/mapWalker.js b/src/mapWalker.js
index 301ff709..b8365e3d 100644
--- a/src/mapWalker.js
+++ b/src/mapWalker.js
@@ -56,9 +56,8 @@ const MapWalker = new Lang.Class({
// Zoom to the maximal zoom-level that fits the place type
zoomToFit: function() {
let zoom;
-
if (this._boundingBox !== null) {
- this._view.zoom_level = this._view.max_zoom_level;
+ this._view.zoom_level = this._view.max_zoom_level - 1;
this._view.ensure_visible(this._boundingBox, false);
} else {
switch (this.place.place_type) {