[gnome-maps] mapView: Minor refactor



commit a137d34f68ad90ff8beda7fcfaa5c394f1766bb1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 11 17:55:21 2013 +0300

    mapView: Minor refactor
    
    Separate function for adding a mark.

 src/mapView.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 8c26ad3..9c63f9e 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -252,12 +252,7 @@ const MapView = new Lang.Class({
 
         locations.forEach(Lang.bind(this,
             function(location) {
-                log ("location: " + location);
-                let marker = new Champlain.Label();
-                marker.set_text(location.description);
-                marker.set_location(location.latitude, location.longitude);
-                this._markerLayer.add_marker(marker);
-                log ("Added marker at " + location.latitude + ", " + location.longitude);
+                this._addMarker(location);
             }));
 
         if (locations.length == 1)
@@ -266,6 +261,15 @@ const MapView = new Lang.Class({
             this._ensureVisible(locations);
     },
 
+    _addMarker: function(location) {
+        log ("location: " + location);
+        let marker = new Champlain.Label();
+        marker.set_text(location.description);
+        marker.set_location(location.latitude, location.longitude);
+        this._markerLayer.add_marker(marker);
+        log ("Added marker at " + location.latitude + ", " + location.longitude);
+    },
+
     _ensureVisible: function(locations) {
         let min_latitude = 90;
         let max_latitude = -90;


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