[gnome-maps] mapMarker: Zoom in on double-click



commit 102d8909f856943bf7f7844df7e730912e73424d
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Wed Jan 7 09:26:04 2015 -0500

    mapMarker: Zoom in on double-click
    
    This sort of matches the double-click to zoom we have on the map
    canvas.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741761

 src/mapMarker.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/mapMarker.js b/src/mapMarker.js
index 96185d5..30a2e1b 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -55,6 +55,7 @@ const MapMarker = new Lang.Class({
 
         this.connect('notify::size', this._translateMarkerPosition.bind(this));
         this.connect('notify::selected', this._onMarkerSelected.bind(this));
+        this.connect('button-press', this._onButtonPress.bind(this));
 
         // Some markers are draggable, we want to sync the marker location and
         // the location saved in the GeocodePlace
@@ -67,6 +68,14 @@ const MapMarker = new Lang.Class({
                            GObject.BindingFlags.DEFAULT);
     },
 
+    _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);
+        }
+    },
+
     _translateMarkerPosition: function() {
         this.set_translation(-this.anchor.x, -this.anchor.y, 0);
     },
@@ -188,7 +197,6 @@ const MapMarker = new Lang.Class({
                                              this.set_selected.bind(this, false));
         let dragMotionSignalId = this.connect('drag-motion',
                                               this.set_selected.bind(this, false));
-
         Utils.once(this.bubble, 'closed', (function() {
             this._mapView.disconnect(markerSelectedSignalId);
             this._mapView.disconnect(goingToSignalId);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]