[gnome-maps/wip/mlundblad/es6] WIP: Use ES6 arrow notation



commit 54fac6bba4fa1060915f2078cbfca78b3173145f
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Nov 10 23:45:20 2017 +0100

    WIP: Use ES6 arrow notation

 src/accountListBox.js              |   11 +--
 src/application.js                 |   34 ++++-----
 src/checkIn.js                     |    4 +-
 src/checkInDialog.js               |   24 +++----
 src/contextMenu.js                 |   26 +++----
 src/exportViewDialog.js            |   23 ++----
 src/favoritesPopover.js            |   18 ++---
 src/geoJSONSource.js               |   40 +++++------
 src/geoclue.js                     |   10 ++--
 src/geocodeService.js              |   10 +--
 src/graphHopper.js                 |   22 +++---
 src/layersPopover.js               |   22 +++---
 src/locationServiceNotification.js |    9 +--
 src/longPrintLayout.js             |    2 +-
 src/mainWindow.js                  |   75 ++++++++-----------
 src/mapBubble.js                   |   16 ++--
 src/mapMarker.js                   |   49 ++++++-------
 src/mapSource.js                   |    9 +--
 src/mapView.js                     |   73 +++++++++----------
 src/mapWalker.js                   |   12 ++--
 src/notification.js                |    4 +-
 src/notificationManager.js         |    8 +-
 src/openTripPlanner.js             |  141 +++++++++++++++++-------------------
 23 files changed, 289 insertions(+), 353 deletions(-)
---
diff --git a/src/accountListBox.js b/src/accountListBox.js
index df5eb4c..e45a21e 100644
--- a/src/accountListBox.js
+++ b/src/accountListBox.js
@@ -61,11 +61,10 @@ var AccountListBox = new Lang.Class({
         params.activate_on_single_click = true;
         this.parent(params);
 
-        Application.checkInManager.connect('accounts-refreshed', this.refresh.bind(this));
+        Application.checkInManager.connect('accounts-refreshed', () => { this.refresh(); });
 
-        this.connect('row-activated', (function(list, row) {
-            this.emit('account-selected', row.account);
-        }).bind(this));
+        this.connect('row-activated',
+                     (list, row) => { this.emit('account-selected', row.account); });
 
         this.refresh();
     },
@@ -77,8 +76,6 @@ var AccountListBox = new Lang.Class({
             row.destroy();
         });
 
-        accounts.forEach((function(account) {
-            this.add(new AccountRow({ account: account }));
-        }).bind(this));
+        accounts.forEach((account) => { this.add(new AccountRow({ account: account })); });
     }
 });
diff --git a/src/application.js b/src/application.js
index 9cc5888..c155ba3 100644
--- a/src/application.js
+++ b/src/application.js
@@ -87,9 +87,7 @@ var Application = new Lang.Class({
         GLib.set_application_name(_("Maps"));
 
         /* Needed to be able to use in UI files */
-        _ensuredTypes.forEach(function(type) {
-            GObject.type_ensure(type);
-        });
+        _ensuredTypes.forEach((type) => { GObject.type_ensure(type); });
 
         this.parent({ application_id: 'org.gnome.Maps',
                       flags: Gio.ApplicationFlags.HANDLES_OPEN });
@@ -105,7 +103,7 @@ var Application = new Lang.Class({
         this.add_main_option('version', 'v'.charCodeAt(0), GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
                              _("Show the version of the program"), null);
 
-        this.connect('handle-local-options', (function(app, options) {
+        this.connect('handle-local-options', (app, options) => {
             if (options.contains('local')) {
                 let variant = options.lookup_value('local', null);
                 this.local_tile_path = variant.deep_unpack();
@@ -119,7 +117,7 @@ var Application = new Lang.Class({
             }
 
             return -1;
-        }).bind(this));
+        });
     },
 
     _checkNetwork: function() {
@@ -127,17 +125,17 @@ var Application = new Lang.Class({
     },
 
     _showContact: function(id) {
-        contactStore.lookup(id, (function(contact) {
+        contactStore.lookup(id, (contact) => {
             this._mainWindow.markBusy();
             if (!contact) {
                 this._mainWindow.unmarkBusy();
                 return;
             }
-            contact.geocode((function() {
+            contact.geocode(() => {
                 this._mainWindow.unmarkBusy();
                 this._mainWindow.mapView.showContact(contact);
-            }).bind(this));
-        }).bind(this));
+            });
+        });
     },
 
     _onShowContactActivate: function(action, parameter) {
@@ -150,10 +148,10 @@ var Application = new Lang.Class({
         if (contactStore.state === Maps.ContactStoreState.LOADED) {
             this. _showContact(id);
         } else {
-            Utils.once(contactStore, 'notify::state', (function() {
+            Utils.once(contactStore, 'notify::state', () => {
                 if (contactStore.state === Maps.ContactStoreState.LOADED)
                     this._showContact(id);
-            }).bind(this));
+            });
         }
     },
 
@@ -165,13 +163,13 @@ var Application = new Lang.Class({
         let dialog = osmEdit.createAccountDialog(this._mainWindow, false);
 
         dialog.show();
-        dialog.connect('response', dialog.destroy.bind(dialog));
+        dialog.connect('response', () => { dialog.destroy(); });
     },
 
     _addContacts: function() {
-        contactStore.get_contacts().forEach(function(contact) {
+        contactStore.get_contacts().forEach((contact) => {
             contact.geocode(function() {
-                contact.get_places().forEach(function(p) {
+                contact.get_places().forEach((p) => {
                     if (!p.location)
                         return;
 
@@ -199,10 +197,10 @@ var Application = new Lang.Class({
         if (contactStore.state === Maps.ContactStoreState.LOADED) {
             this._addContacts();
         } else {
-            Utils.once(contactStore, 'notify::state', (function() {
+            Utils.once(contactStore, 'notify::state', () => {
                 if (contactStore.state === Maps.ContactStoreState.LOADED)
                     this._addContacts();
-            }).bind(this));
+            });
         }
     },
 
@@ -264,9 +262,9 @@ var Application = new Lang.Class({
         notificationManager = new NotificationManager.NotificationManager(overlay);
         this._mainWindow = new MainWindow.MainWindow({ application: this,
                                                        overlay: overlay });
-        this._mainWindow.connect('destroy', this._onWindowDestroy.bind(this));
+        this._mainWindow.connect('destroy', () => { this._onWindowDestroy(); });
         if (GLib.getenv('MAPS_DEBUG') === 'focus') {
-            this._mainWindow.connect('set-focus', function(window, widget) {
+            this._mainWindow.connect('set-focus', (window, widget) => {
                 log('* focus widget: %s'.format(widget));
             });
         }
diff --git a/src/checkIn.js b/src/checkIn.js
index d6849c5..d75d492 100644
--- a/src/checkIn.js
+++ b/src/checkIn.js
@@ -84,7 +84,7 @@ var CheckInManager = new Lang.Class({
         this._accountsCount = 0;
         this._authorizers = {};
 
-        accounts.forEach((function(object) {
+        accounts.forEach((object) => {
             if (!object.get_account())
                 return;
 
@@ -95,7 +95,7 @@ var CheckInManager = new Lang.Class({
             this._accounts.push(object);
 
             this._authorizers[accountId] = this._getBackend(object).createAuthorizer(object);
-        }).bind(this));
+        });
 
         this.emit('accounts-refreshed');
         this.notify('hasCheckIn');
diff --git a/src/checkInDialog.js b/src/checkInDialog.js
index 9b0b700..4761b61 100644
--- a/src/checkInDialog.js
+++ b/src/checkInDialog.js
@@ -85,20 +85,18 @@ var CheckInDialog = new Lang.Class({
             this._cancellable.cancel();
         }).bind(this));
 
-        Application.checkInManager.connect('accounts-refreshed', this._onAccountRefreshed.bind(this));
+        Application.checkInManager.connect('accounts-refreshed',
+                                           () => { this._onAccountRefreshed() });
 
         this._initHeaderBar();
         this._initWidgets();
     },
 
     _initHeaderBar: function() {
-        this._cancelButton.connect('clicked', (function() {
-            this._cancellable.cancel();
-        }).bind(this));
+        this._cancelButton.connect('clicked',
+                                   () => { this._cancellable.cancel(); });
 
-        this._okButton.connect('clicked', (function() {
-            this._startCheckInStep();
-        }).bind(this));
+        this._okButton.connect('clicked', () => { this._startCheckInStep(); });
     },
 
     _initWidgets: function() {
@@ -125,15 +123,15 @@ var CheckInDialog = new Lang.Class({
                                   this._foursquareOptionsBroadcastTwitterCheckButton,
                                   'active', Gio.SettingsBindFlags.DEFAULT);
 
-        this._accountListBox.connect('account-selected', (function(list, account) {
+        this._accountListBox.connect('account-selected', (list, account) => {
             this._account = account;
             this._startPlaceStep();
-        }).bind(this));
+        });
 
-        this._placeListBox.connect('place-selected', (function(list, place) {
+        this._placeListBox.connect('place-selected', (list, place) => {
             this._checkIn.place = place;
             this._startMessageStep();
-        }).bind(this));
+        });
     },
 
     vfunc_show: function() {
@@ -150,9 +148,9 @@ var CheckInDialog = new Lang.Class({
             this._account = Application.checkInManager.accounts[0];
             this._startPlaceStep();
         } else {
-            Mainloop.idle_add((function() {
+            Mainloop.idle_add(() => {
                 this.response(Response.FAILURE_CHECKIN_DISABLED);
-            }).bind(this));
+            });
         }
     },
 
diff --git a/src/contextMenu.js b/src/contextMenu.js
index 5306093..c80b42b 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -81,10 +81,8 @@ var ContextMenu = new Lang.Class({
         this._latitude = this._mapView.view.y_to_latitude(y);
 
         if (button === Gdk.BUTTON_SECONDARY) {
-            Mainloop.idle_add((function() {
-                // Need idle to avoid Clutter dead-lock on re-entrance
-                this.popup_at_pointer(event);
-            }).bind(this));
+            // Need idle to avoid Clutter dead-lock on re-entrance
+            Mainloop.idle_add(() => { this.popup_at_pointer(event); });
         }
     },
 
@@ -125,14 +123,14 @@ var ContextMenu = new Lang.Class({
                                                longitude: this._longitude,
                                                accuracy: 0 });
 
-        Application.geocodeService.reverse(location, null, (function(place) {
+        Application.geocodeService.reverse(location, null, (place) => {
             if (place) {
                 this._mapView.showPlace(place, false);
             } else {
                 let msg = _("Nothing found here!");
                 Application.notificationManager.showMessage(msg);
             }
-        }).bind(this));
+        });
     },
 
     _onGeoURIActivated: function() {
@@ -153,11 +151,11 @@ var ContextMenu = new Lang.Class({
             let dialog = osmEdit.createAccountDialog(this._mainWindow, true);
 
             dialog.show();
-            dialog.connect('response', (function(dialog, response) {
+            dialog.connect('response', (dialog, response) => {
                 dialog.destroy();
                 if (response === OSMAccountDialog.Response.SIGNED_IN)
                     this._addOSMLocation();
-            }).bind(this));
+            });
 
             return;
         }
@@ -182,13 +180,13 @@ var ContextMenu = new Lang.Class({
                                       this._latitude, this._longitude);
 
         dialog.show();
-        dialog.connect('response', (function(dialog, response) {
+        dialog.connect('response', (dialog, response) => {
             dialog.destroy();
             if (response === OSMEditDialog.Response.UPLOADED) {
                 Application.notificationManager.showMessage(
                     _("Location was added to the map, note that it may take a while before it shows on the 
map and in search results."));
             }
-        }).bind(this));
+        });
     },
 
     _activateExport: function() {
@@ -206,9 +204,7 @@ var ContextMenu = new Lang.Class({
             mapView: this._mapView
         });
 
-        dialog.connect('response', function() {
-            dialog.destroy();
-        });
+        dialog.connect('response', () => { dialog.destroy(); });
         dialog.show_all();
     },
 
@@ -216,12 +212,12 @@ var ContextMenu = new Lang.Class({
         if (this._mapView.view.state === Champlain.State.DONE) {
             this._activateExport();
         } else {
-            let notifyId = this._mapView.view.connect('notify::state', (function() {
+            let notifyId = this._mapView.view.connect('notify::state', () => {
                 if (this._mapView.view.state === Champlain.State.DONE) {
                     this._mapView.view.disconnect(notifyId);
                     this._activateExport();
                 }
-            }).bind(this));
+            });
         }
     }
 });
diff --git a/src/exportViewDialog.js b/src/exportViewDialog.js
index 243e48b..c946563 100644
--- a/src/exportViewDialog.js
+++ b/src/exportViewDialog.js
@@ -60,17 +60,11 @@ var ExportViewDialog = new Lang.Class({
         params.use_header_bar = true;
         this.parent(params);
 
-        this._cancelButton.connect('clicked', (function() {
-            this.response(Response.CANCEL);
-        }).bind(this));
-        this._exportButton.connect('clicked', this._exportView.bind(this));
-        this._filenameEntry.connect('changed',
-                                    this._onFileNameChanged.bind(this));
-        this._fileChooserButton.connect('file-set',
-                                        this._onFolderChanged.bind(this));
-
-        this._layersCheckButton.connect('toggled',
-                                        this._includeLayersChanged.bind(this));
+        this._cancelButton.connect('clicked', () => { this.response(Response.CANCEL); });
+        this._exportButton.connect('clicked', () => { this._exportView(); });
+        this._filenameEntry.connect('changed', () => { this._onFileNameChanged(); });
+        this._fileChooserButton.connect('file-set', () => { this._onFolderChanged(); });
+        this._layersCheckButton.connect('toggled', () => { this._includeLayersChanged() });
 
 
         this._folder = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES);
@@ -99,7 +93,8 @@ var ExportViewDialog = new Lang.Class({
         let height = surfaceHeight * this._scaleFactor;
 
         this._previewArea.set_size_request(width, height);
-        this._previewArea.connect('draw', this._drawPreview.bind(this));
+        this._previewArea.connect('draw',
+                                  (w, cr) => { this._drawPreview(w, cr); });
     },
 
     _drawPreview: function(widget, cr) {
@@ -176,9 +171,7 @@ var ExportViewDialog = new Lang.Class({
                 secondary_text: details
             });
 
-            dialog.connect('response', function() {
-                dialog.destroy();
-            });
+            dialog.connect('response', () => { dialog.destroy(); });
             dialog.show_all();
         }
     },
diff --git a/src/favoritesPopover.js b/src/favoritesPopover.js
index b6df29a..cd1a328 100644
--- a/src/favoritesPopover.js
+++ b/src/favoritesPopover.js
@@ -80,16 +80,16 @@ var FavoritesPopover = new Lang.Class({
         }).bind(this));
 
         this._entry.connect('changed',
-                            this._list.invalidate_filter.bind(this._list));
+                            () => { this._list.invalidate_filter(this._list); });
 
-        this._list.connect('row-activated', (function(list, row) {
+        this._list.connect('row-activated', (list, row) => {
             this.hide();
             this._mapView.showPlace(row.place, true);
-        }).bind(this));
+        });
 
-        this._list.set_filter_func((function(row) {
+        this._list.set_filter_func((row) => {
             return row.place.match(this._entry.text);
-        }).bind(this));
+        });
 
         this._updateList();
     },
@@ -106,12 +106,10 @@ var FavoritesPopover = new Lang.Class({
     },
 
     _updateList: function() {
-        this._list.forall(function(row) {
-            row.destroy();
-        });
+        this._list.forall((row) => { row.destroy(); });
 
         let rows = 0;
-        this._model.foreach((function(model, path, iter) {
+        this._model.foreach((model, path, iter) => {
             let place = model.get_value(iter, PlaceStore.Columns.PLACE);
 
             let row = new PlaceListRow.PlaceListRow({ place: place,
@@ -119,7 +117,7 @@ var FavoritesPopover = new Lang.Class({
                                                       can_focus: true });
             this._list.add(row);
             rows++;
-        }).bind(this));
+        });
 
         this.rows = rows;
     }
diff --git a/src/geoJSONSource.js b/src/geoJSONSource.js
index 09e66a3..0eef485 100644
--- a/src/geoJSONSource.js
+++ b/src/geoJSONSource.js
@@ -78,15 +78,15 @@ var GeoJSONSource = new Lang.Class({
         if (tile.get_state() === Champlain.State.DONE)
             return;
 
-        tile.connect('render-complete', (function(tile, data, size, error) {
+        tile.connect('render-complete', (tile, data, size, error) => {
             if(!error) {
                 tile.set_state(Champlain.State.DONE);
                 tile.display_content();
             } else if(this.next_source)
                 this.next_source.fill_tile(tile);
-        }).bind(this));
+        });
 
-        Mainloop.idle_add(this._renderTile.bind(this, tile));
+        Mainloop.idle_add(() => { this._renderTile(tile); });
     },
 
     _validate: function([lon, lat]) {
@@ -99,10 +99,10 @@ var GeoJSONSource = new Lang.Class({
     },
 
     _compose: function(coordinates) {
-        coordinates.forEach((function(coordinate) {
+        coordinates.forEach((coordinate) => {
             this._validate(coordinate);
             this._bbox.extend(coordinate[1], coordinate[0]);
-        }).bind(this));
+        });
     },
 
     _clampBBox: function() {
@@ -117,9 +117,7 @@ var GeoJSONSource = new Lang.Class({
     },
 
     _parsePolygon: function(coordinates) {
-        coordinates.forEach((function(coordinate) {
-            this._compose(coordinate);
-        }).bind(this));
+        coordinates.forEach((coordinate) => { this._compose(coordinate); });
     },
 
     _parsePoint: function(coordinates, properties) {
@@ -154,9 +152,9 @@ var GeoJSONSource = new Lang.Class({
             break;
 
         case 'MultiLineString':
-            geometry.coordinates.forEach((function(coordinate) {
+            geometry.coordinates.forEach((coordinate) => {
                 this._parseLineString(coordinate);
-            }).bind(this));
+            });
             break;
 
         case 'Polygon':
@@ -164,9 +162,9 @@ var GeoJSONSource = new Lang.Class({
             break;
 
         case 'MultiPolygon':
-            geometry.coordinates.forEach((function(coordinate) {
+            geometry.coordinates.forEach((coordinate) => {
                 this._parsePolygon(coordinate);
-            }).bind(this));
+            });
             break;
 
         case 'Point':
@@ -174,9 +172,9 @@ var GeoJSONSource = new Lang.Class({
             break;
 
         case 'MultiPoint':
-            geometry.coordinates.forEach((function(coordinate, properties) {
+            geometry.coordinates.forEach((coordinate, properties) => {
                 this._parsePoint(coordinate,properties);
-            }).bind(this));
+            });
             break;
 
         default:
@@ -190,9 +188,9 @@ var GeoJSONSource = new Lang.Class({
 
         switch(root.type) {
         case 'FeatureCollection':
-            root.features.forEach((function(feature) {
+            root.features.forEach((feature) => {
                 this._parseGeometry(feature.geometry, feature.properties);
-            }).bind(this));
+            });
             break;
 
         case 'Feature':
@@ -203,7 +201,7 @@ var GeoJSONSource = new Lang.Class({
             if (!root.geometries)
                 throw new Error(_("parse error"));
 
-            root.geometries.forEach(this._parseGeometry.bind(this));
+            root.geometries.forEach((g) => { this._parseGeometry(g); });
             break;
 
         default:
@@ -226,7 +224,7 @@ var GeoJSONSource = new Lang.Class({
                                            height: TILE_SIZE,
                                            content: content });
 
-        content.connect('draw', (function(canvas, cr) {
+        content.connect('draw', (canvas, cr) => {
             tile.set_surface(cr.getTarget());
             cr.setOperator(Cairo.Operator.CLEAR);
             cr.paint();
@@ -238,13 +236,13 @@ var GeoJSONSource = new Lang.Class({
                 return;
             }
 
-            tileJSON.features.forEach(function(feature) {
+            tileJSON.features.forEach((feature) => {
                 if (feature.type === TileFeature.POINT)
                     return;
 
                 let geoJSONStyleObj = GeoJSONStyle.GeoJSONStyle.parseSimpleStyle(feature.tags);
 
-                feature.geometry.forEach(function(geometry) {
+                feature.geometry.forEach((geometry) => {
                     let first = true;
                     cr.moveTo(0, 0);
                     cr.setLineWidth(geoJSONStyleObj.lineWidth);
@@ -276,7 +274,7 @@ var GeoJSONSource = new Lang.Class({
             });
 
             tile.emit('render-complete', null, 0, false);
-        }).bind(this));
+        });
 
         content.invalidate();
     }
diff --git a/src/geoclue.js b/src/geoclue.js
index 74e962b..f2f5949 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -75,7 +75,7 @@ var Geoclue = new Lang.Class({
         let id = 'org.gnome.Maps';
         let level = GClue.AccuracyLevel.EXACT;
 
-        GClue.Simple.new(id, level, null, (function(object, result) {
+        GClue.Simple.new(id, level, null, (object, result) => {
             try {
                 this._simple = GClue.Simple.new_finish(result);
             }
@@ -91,16 +91,16 @@ var Geoclue = new Lang.Class({
             }
 
             this._simple.connect('notify::location',
-                           this._onLocationNotify.bind(this));
-            this._simple.client.connect('notify::active', (function() {
+                                 () => { this._onLocationNotify() });
+            this._simple.client.connect('notify::active', () => {
                 this.state = this._simple.client.active ? State.ON : State.DENIED;
-            }).bind(this));
+            });
 
             this.state = State.ON;
             this._onLocationNotify(this._simple);
             if (callback)
                 callback(true);
-        }).bind(this));
+        });
     },
 
     _onLocationNotify: function(simple) {
diff --git a/src/geocodeService.js b/src/geocodeService.js
index 38a60c1..8c90cfb 100644
--- a/src/geocodeService.js
+++ b/src/geocodeService.js
@@ -47,14 +47,12 @@ var GeocodeService = new Lang.Class({
         }
         forward.bounded = false;
         forward.set_answer_count(answerCount);
-        forward.search_async(cancellable, function(forward, res) {
+        forward.search_async(cancellable, (forward, res) => {
             try {
                 let places = forward.search_finish(res);
 
                 if (places !== null) {
-                    places = places.map(function(p) {
-                        return new Place.Place({ place: p });
-                    });
+                    places = places.map((p) => { return new Place.Place({ place: p }); });
                 }
 
                 callback(places);
@@ -68,7 +66,7 @@ var GeocodeService = new Lang.Class({
         let reverse = Geocode.Reverse.new_for_location(location);
 
         Application.application.mark_busy();
-        reverse.resolve_async(cancellable, (function(reverse, res) {
+        reverse.resolve_async(cancellable, (reverse, res) => {
             Application.application.unmark_busy();
             try {
                 let place = new Place.Place({ place: reverse.resolve_finish(res) });
@@ -80,6 +78,6 @@ var GeocodeService = new Lang.Class({
                             e.message);
                 callback(null);
             }
-        }).bind(this));
+        });
     }
 });
diff --git a/src/graphHopper.js b/src/graphHopper.js
index afb049e..bd1281d 100644
--- a/src/graphHopper.js
+++ b/src/graphHopper.js
@@ -52,7 +52,7 @@ var GraphHopper = new Lang.Class({
     },
 
     _updateFromStored: function() {
-        Mainloop.idle_add((function() {
+        Mainloop.idle_add(() => {
             if (!this.storedRoute)
                 return;
 
@@ -62,13 +62,13 @@ var GraphHopper = new Lang.Class({
                                 time: this.storedRoute.time,
                                 bbox: this.storedRoute.bbox });
             this.storedRoute = null;
-        }).bind(this));
+        });
     },
 
     _queryGraphHopper: function(points, transportationType, callback) {
         let url = this._buildURL(points, transportationType);
         let msg = Soup.Message.new('GET', url);
-        this._session.queue_message(msg, (function(session, message) {
+        this._session.queue_message(msg, (session, message) => {
             try {
                 let result = this._parseMessage(message);
                 if (!result)
@@ -78,7 +78,7 @@ var GraphHopper = new Lang.Class({
             } catch (e) {
                 callback(null, e);
             }
-        }).bind(this));
+        });
     },
 
     fetchRoute: function(points, transportationType) {
@@ -88,7 +88,7 @@ var GraphHopper = new Lang.Class({
         }
 
         this._queryGraphHopper(points, transportationType,
-                               (function(result, exception) {
+                               (result, exception) => {
             if (exception) {
                 Application.notificationManager.showMessage(_("Route request failed."));
                 Utils.debug(e);
@@ -108,19 +108,19 @@ var GraphHopper = new Lang.Class({
                     this.route.update(route);
                 }
             }
-        }).bind(this));
+        });
     },
 
     fetchRouteAsync: function(points, transportationType, callback) {
         this._queryGraphHopper(points, transportationType,
-                               (function(result, exception) {
+                               (result, exception) => {
             if (result) {
                 let route = this._createRoute(result.paths[0]);
                 callback(route, exception);
             } else {
                 callback(null, exception);
             }
-        }).bind(this));
+        });
     },
 
     _buildURL: function(points, transportation) {
@@ -157,7 +157,7 @@ var GraphHopper = new Lang.Class({
         if (!Array.isArray(result.paths)) {
             Utils.debug("No route found");
             if (result.info && Array.isArray(result.info.errors)) {
-                result.info.errors.forEach(function({ message, details }) {
+                result.info.errors.forEach(({ message, details }) => {
                     Utils.debug("Message: " + message);
                     Utils.debug("Details: " + details);
                 });
@@ -194,7 +194,7 @@ var GraphHopper = new Lang.Class({
             time:        0,
             turnAngle:   0
         });
-        let rest = instructions.map((function(instr) {
+        let rest = instructions.map((instr) => {
             let type = this._createTurnPointType(instr.sign);
             let text = instr.text;
             if (type === Route.TurnPointType.VIA) {
@@ -210,7 +210,7 @@ var GraphHopper = new Lang.Class({
                 time:        instr.time,
                 turnAngle:   instr.turn_angle
             });
-        }).bind(this));
+        });
         return [startPoint].concat(rest);
     },
 
diff --git a/src/layersPopover.js b/src/layersPopover.js
index a5c7fa3..8d32a5b 100644
--- a/src/layersPopover.js
+++ b/src/layersPopover.js
@@ -39,7 +39,7 @@ var ShapeLayerRow = new Lang.Class({
 
         this._layerLabel.label = this.shapeLayer.getName();
         this._layerLabel.tooltip_text = this.shapeLayer.file.get_parse_name();
-        this._visibleButton.connect('clicked', (function() {
+        this._visibleButton.connect('clicked', () => {
             let image = this._visibleButton.get_child();
 
             this.shapeLayer.visible = !this.shapeLayer.visible;
@@ -48,7 +48,7 @@ var ShapeLayerRow = new Lang.Class({
                 image.icon_name = 'layer-visible-symbolic';
             else
                 image.icon_name = 'layer-not-visible-symbolic';
-        }).bind(this));
+        });
     }
 });
 
@@ -76,22 +76,22 @@ var LayersPopover = new Lang.Class({
 
         this._layersListBox.bind_model(this._mapView.shapeLayerStore,
                                          this._listBoxCreateWidget.bind(this));
-        this._layersListBox.connect('row-activated', (function(lb, row) {
+        this._layersListBox.connect('row-activated', (lb, row) => {
             this._mapView.gotoBBox(row.shapeLayer.bbox);
-        }).bind(this));
+        });
 
-        this._layersListBox.set_header_func(function(row, before) {
+        this._layersListBox.set_header_func((row, before) => {
             let header = before ? new Gtk.Separator() : null;
             row.set_header(header);
         });
 
-        this._streetLayerButton.connect('clicked', (function () {
+        this._streetLayerButton.connect('clicked', () => {
             this._mapView.setMapType(MapView.MapType.STREET);
-        }).bind(this));
+        });
 
-        this._aerialLayerButton.connect('clicked', (function () {
+        this._aerialLayerButton.connect('clicked', () => {
             this._mapView.setMapType(MapView.MapType.AERIAL);
-        }).bind(this));
+        });
     },
 
     setMapType: function(mapType) {
@@ -101,7 +101,7 @@ var LayersPopover = new Lang.Class({
             this._aerialLayerButton.active = true;
     },
 
-    _onRemoveClicked: function(row, button) {
+    _onRemoveClicked: function(row) {
         this._mapView.removeShapeLayer(row.shapeLayer);
         if (this._layersListBox.get_children().length <= 0)
             this._layersListBox.hide();
@@ -110,7 +110,7 @@ var LayersPopover = new Lang.Class({
     _listBoxCreateWidget: function(shapeLayer) {
         let row = new ShapeLayerRow({ shapeLayer: shapeLayer });
         row.closeButton.connect('clicked',
-                                this._onRemoveClicked.bind(this, row));
+                                () => { this._onRemoveClicked(row); });
         this._layersListBox.show();
         return row;
     }
diff --git a/src/locationServiceNotification.js b/src/locationServiceNotification.js
index acb8cf4..9cf6219 100644
--- a/src/locationServiceNotification.js
+++ b/src/locationServiceNotification.js
@@ -40,7 +40,7 @@ var LocationServiceNotification = new Lang.Class({
         let ui = Utils.getUIObject('location-service-notification',
                                    [ 'button', 'grid' ]);
 
-        ui.button.connect('clicked', (function() {
+        ui.button.connect('clicked', () => {
             let privacyInfo = Gio.DesktopAppInfo.new(_PRIVACY_PANEL);
 
             try {
@@ -51,15 +51,14 @@ var LocationServiceNotification = new Lang.Class({
                 Utils.debug('launching privacy panel failed: ' + e);
             }
 
-            Application.geoclue.connect('notify::state', (function() {
+            Application.geoclue.connect('notify::state', () => {
                 if (!this.parent)
                     return;
 
                 if (Application.geoclue.state == Geoclue.State.ON)
                     this.dismiss();
-            }).bind(this));
-
-        }).bind(this));
+            });
+        });
 
         this._ui.body.add(ui.grid);
     }
diff --git a/src/longPrintLayout.js b/src/longPrintLayout.js
index 8f274e1..956a76e 100644
--- a/src/longPrintLayout.js
+++ b/src/longPrintLayout.js
@@ -49,7 +49,7 @@ var LongPrintLayout = new Lang.Class({
         let totalSurfaces = 4 + this._route.turnPoints.length;
 
         /* Plus via points */
-        this._route.turnPoints.forEach(function(turnPoint) {
+        this._route.turnPoints.forEach((turnPoint) => {
             if (turnPoint.type === Route.TurnPointType.VIA)
                 totalSurfaces++;
         });
diff --git a/src/mainWindow.js b/src/mainWindow.js
index f9b80d5..7bbed67 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -60,16 +60,16 @@ var ShapeLayerFileChooser = new Lang.Class({
         this.add_filter(allFilter);
         this.set_filter(allFilter);
 
-        ShapeLayer.SUPPORTED_TYPES.forEach((function(layerClass) {
+        ShapeLayer.SUPPORTED_TYPES.forEach((layerClass) => {
             let filter = new Gtk.FileFilter();
-            [filter, allFilter].forEach(function(f) {
-                layerClass.mimeTypes.forEach(function(type) {
+            [filter, allFilter].forEach((f) => {
+                layerClass.mimeTypes.forEach((type) => {
                     f.add_mime_type(type);
                 });
             });
             filter.set_name(layerClass.displayName);
             this.add_filter(filter);
-        }).bind(this));
+        });
     }
 });
 
@@ -145,27 +145,22 @@ var MainWindow = new Lang.Class({
                                                      loupe: true,
                                                      matchRoute: true
                                                    });
-        placeEntry.connect('notify::place', (function() {
+        placeEntry.connect('notify::place', () => {
             if (placeEntry.place) {
                 this._mapView.showPlace(placeEntry.place, true);
             }
-        }).bind(this));
+        });
 
         let popover = placeEntry.popover;
-        popover.connect('selected', (function() {
-            this._mapView.grab_focus();
-        }).bind(this));
-        this._mapView.view.connect('button-press-event', (function () {
-            popover.hide();
-        }));
+        popover.connect('selected', () => { this._mapView.grab_focus(); });
+        this._mapView.view.connect('button-press-event', () => { popover.hide(); });
         return placeEntry;
     },
 
     _createSidebar: function() {
         let sidebar = new Sidebar.Sidebar(this._mapView);
 
-        Application.routeQuery.connect('notify',
-                                       this._setRevealSidebar.bind(this, true));
+        Application.routeQuery.connect('notify', () => { this._setRevealSidebar(true); });
         this._toggleSidebarButton.bind_property('active',
                                                 this._mapView, 'routingOpen',
                                                 GObject.BindingFlags.BIDIRECTIONAL);
@@ -179,18 +174,18 @@ var MainWindow = new Lang.Class({
         this.drag_dest_set(Gtk.DestDefaults.DROP, null, 0);
         this.drag_dest_add_uri_targets();
 
-        this.connect('drag-motion', (function(widget, ctx, x, y, time) {
+        this.connect('drag-motion', (widget, ctx, x, y, time) => {
             Gdk.drag_status(ctx, Gdk.DragAction.COPY, time);
             return true;
-        }).bind(this));
+        });
 
-        this.connect('drag-data-received', (function(widget, ctx, x, y, data, info, time) {
+        this.connect('drag-data-received', (widget, ctx, x, y, data, info, time) => {
             let files = data.get_uris().map(Gio.file_new_for_uri);
             if (this._mapView.openShapeLayers(files))
                 Gtk.drag_finish(ctx, true, false, time);
             else
                 Gtk.drag_finish(ctx, false, false, time);
-        }).bind(this));
+        });
     },
 
     _initActions: function() {
@@ -256,27 +251,25 @@ var MainWindow = new Lang.Class({
 
         this.connect('window-state-event',
                      this._onWindowStateEvent.bind(this));
-        this._mapView.view.connect('button-press-event', (function() {
+        this._mapView.view.connect('button-press-event', () => {
             // Can not call something that will generate clutter events
             // from a clutter event-handler. So use an idle.
-            Mainloop.idle_add((function() {
-                this._mapView.grab_focus();
-            }).bind(this));
-        }).bind(this));
+            Mainloop.idle_add(() => { this._mapView.grab_focus(); });
+        });
 
-        this.application.connect('notify::connected', (function() {
+        this.application.connect('notify::connected', () => {
             if (this.application.connected || this.application.local_tile_path)
                 this._mainStack.visible_child = this._overlay;
             else
                 this._mainStack.visible_child = this._noNetworkView;
-        }).bind(this));
+        });
 
         /*
          * If the currently focused widget is an entry then we will
          * hijack the key-press to the main window and make sure that
          * they reach the entry before they can be swallowed as accelerator.
          */
-        this.connect('key-press-event', (function(window, event) {
+        this.connect('key-press-event', (window, event) => {
             let focusWidget = window.get_focus();
             let keyval = event.get_keyval()[1];
             let keys = [Gdk.KEY_plus, Gdk.KEY_KP_Add,
@@ -303,7 +296,7 @@ var MainWindow = new Lang.Class({
                 return focusWidget.event(event);
 
             return false;
-        }).bind(this));
+        });
     },
 
     _updateLocationSensitivity: function() {
@@ -320,16 +313,16 @@ var MainWindow = new Lang.Class({
 
         let favoritesPopover = this._favoritesButton.popover;
         this._favoritesButton.sensitive = favoritesPopover.rows > 0;
-        favoritesPopover.connect('notify::rows', (function() {
+        favoritesPopover.connect('notify::rows', () => {
             this._favoritesButton.sensitive = favoritesPopover.rows > 0;
-        }).bind(this));
+        });
 
         this._mapView.bind_property('routeShowing', this._printRouteButton,
                                     'visible', GObject.BindingFlags.DEFAULT);
 
         Application.geoclue.connect('notify::state',
                                     this._updateLocationSensitivity.bind(this));
-        this.application.connect('notify::connected', (function() {
+        this.application.connect('notify::connected', () => {
             let app = this.application;
 
             this._updateLocationSensitivity();
@@ -339,7 +332,7 @@ var MainWindow = new Lang.Class({
                                                favoritesPopover.rows > 0);
             this._placeEntry.sensitive = app.connected;
             this._printRouteButton.sensitive = app.connected;
-        }).bind(this));
+        });
     },
 
     _saveWindowGeometry: function() {
@@ -381,11 +374,11 @@ var MainWindow = new Lang.Class({
             this._configureId = 0;
         }
 
-        this._configureId = Mainloop.timeout_add(_CONFIGURE_ID_TIMEOUT, (function() {
+        this._configureId = Mainloop.timeout_add(_CONFIGURE_ID_TIMEOUT, () => {
             this._saveWindowGeometry();
             this._configureId = 0;
             return false;
-        }).bind(this));
+        });
     },
 
     _onWindowStateEvent: function(widget, event) {
@@ -429,7 +422,7 @@ var MainWindow = new Lang.Class({
             return;
         }
 
-        Application.geoclue.start((function() {
+        Application.geoclue.start(() => {
             switch(Application.geoclue.state) {
             case Geoclue.State.FAILED:
                 message = _("Failed to connect to location service");
@@ -445,7 +438,7 @@ var MainWindow = new Lang.Class({
                 this._mapView.gotoUserLocation(true);
                 break;
             }
-        }).bind(this));
+        });
     },
 
     _printRouteActivate: function() {
@@ -504,9 +497,7 @@ var MainWindow = new Lang.Class({
             transient_for: this
         });
         aboutDialog.show();
-        aboutDialog.connect('response', (function() {
-            aboutDialog.destroy();
-        }));
+        aboutDialog.connect('response', () => { aboutDialog.destroy(); });
     },
 
     _onOpenShapeLayer: function() {
@@ -514,13 +505,13 @@ var MainWindow = new Lang.Class({
             transient_for: this,
         });
 
-        fileChooser.connect('response', (function(widget, response) {
+        fileChooser.connect('response', (widget, response) => {
             if (response === Gtk.ResponseType.ACCEPT) {
                 this._mapView.openShapeLayers(fileChooser.get_files());
                 this.layersPopover.popdown();
             }
             fileChooser.destroy();
-        }).bind(this));
+        });
         fileChooser.show();
     },
 
@@ -531,9 +522,7 @@ var MainWindow = new Lang.Class({
         this._busy.show();
 
         let stage = this._mapView.view.get_stage();
-        this._busySignalId = stage.connect('captured-event', function() {
-            return true;
-        });
+        this._busySignalId = stage.connect('captured-event', () => { return true; });
     },
 
     unmarkBusy: function() {
diff --git a/src/mapBubble.js b/src/mapBubble.js
index d9434bc..543ba51 100644
--- a/src/mapBubble.js
+++ b/src/mapBubble.js
@@ -119,7 +119,7 @@ var MapBubble = new Lang.Class({
             image.icon_name = 'non-starred-symbolic';
         }
 
-        button.connect('clicked', (function() {
+        button.connect('clicked', () => {
             if (placeStore.exists(this._place,
                                   PlaceStore.PlaceType.FAVORITE)) {
                 image.icon_name = 'non-starred-symbolic';
@@ -130,7 +130,7 @@ var MapBubble = new Lang.Class({
                 placeStore.addPlace(this._place,
                                     PlaceStore.PlaceType.FAVORITE);
             }
-        }).bind(this));
+        });
     },
 
     _initSendToButton: function(button) {
@@ -142,8 +142,8 @@ var MapBubble = new Lang.Class({
             return;
 
         button.visible = true;
-        button.connect('clicked', function() {
-            dialog.connect('response', function() {
+        button.connect('clicked', () => {
+            dialog.connect('response', () => {
                 dialog.hide();
             });
             dialog.show_all();
@@ -157,7 +157,7 @@ var MapBubble = new Lang.Class({
 
         button.visible = true;
 
-        button.connect('clicked', (function() {
+        button.connect('clicked', () => {
             query.freeze_notify();
             query.reset();
             Application.routingDelegator.reset();
@@ -170,7 +170,7 @@ var MapBubble = new Lang.Class({
             }
             this.destroy();
             query.thaw_notify();
-        }).bind(this));
+        });
     },
 
     _initCheckInButton: function(button, matchPlace) {
@@ -179,10 +179,10 @@ var MapBubble = new Lang.Class({
                                                  GObject.BindingFlags.DEFAULT |
                                                  GObject.BindingFlags.SYNC_CREATE);
 
-        button.connect('clicked', (function() {
+        button.connect('clicked', () => {
             Application.checkInManager.showCheckInDialog(this.get_toplevel(),
                                                          this.place,
                                                          matchPlace);
-        }).bind(this));
+        });
     }
 });
diff --git a/src/mapMarker.js b/src/mapMarker.js
index 1d237fb..4f158f2 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -106,7 +106,7 @@ var MapMarker = new Lang.Class({
             let canvas = new Clutter.Canvas({ width: pixbuf.get_width(),
                                               height: pixbuf.get_height() });
 
-            canvas.connect('draw', (function(canvas, cr) {
+            canvas.connect('draw', (canvas, cr) => {
                 cr.setOperator(Cairo.Operator.CLEAR);
                 cr.paint();
                 cr.setOperator(Cairo.Operator.OVER);
@@ -115,7 +115,7 @@ var MapMarker = new Lang.Class({
                 cr.paint();
 
                 this._surface = cr.getTarget();
-            }).bind(this));
+            });
 
             let actor = new Clutter.Actor();
             actor.set_content(canvas);
@@ -201,7 +201,7 @@ var MapMarker = new Lang.Class({
 
     _hideBubbleOn: function(signal, duration) {
         let sourceId = null;
-        let signalId = this._view.connect(signal, (function() {
+        let signalId = this._view.connect(signal, () => {
             if (sourceId)
                 Mainloop.source_remove(sourceId);
             else
@@ -216,23 +216,23 @@ var MapMarker = new Lang.Class({
                 sourceId = Mainloop.timeout_add(duration, callback);
             else
                 sourceId = Mainloop.idle_add(callback);
-        }).bind(this));
+        });
 
-        Utils.once(this.bubble, 'closed', (function() {
+        Utils.once(this.bubble, 'closed', () => {
             // We still listening for the signal to refresh
             // the existent timeout
             if (!sourceId)
                 this._view.disconnect(signalId);
-        }).bind(this));
+        });
 
-        Utils.once(this, 'notify::selected', (function() {
+        Utils.once(this, 'notify::selected', () => {
             // When the marker gets deselected, we need to ensure
             // that the timeout callback is not called anymore.
             if (sourceId) {
                 Mainloop.source_remove(sourceId);
                 this._view.disconnect(signalId);
             }
-        }).bind(this));
+        });
     },
 
     _initBubbleSignals: function() {
@@ -246,26 +246,26 @@ var MapMarker = new Lang.Class({
         // does the job.
         this._mapView.onSetMarkerSelected(this);
 
-        let markerSelectedSignalId = this._mapView.connect('marker-selected', (function(mapView, 
selectedMarker) {
+        let markerSelectedSignalId = this._mapView.connect('marker-selected', (mapView, selectedMarker) => {
             if (this.get_parent() !== selectedMarker.get_parent())
                 this.selected = false;
-        }).bind(this));
+        });
 
-        let goingToSignalId = this._mapView.connect('going-to', (function() {
+        let goingToSignalId = this._mapView.connect('going-to', () => {
             this.set_selected(false);
-        }).bind(this));
+        });
         let buttonPressSignalId =
-            this._view.connect('button-press-event', (function() {
+            this._view.connect('button-press-event', () => {
                 this.set_selected(false);
-            }).bind(this));
+            });
         // Destroy the bubble when the marker is destroyed o removed from a layer
-        let parentSetSignalId = this.connect('parent-set', (function() {
+        let parentSetSignalId = this.connect('parent-set', () => {
             this.set_selected(false);
-        }).bind(this));
-        let dragMotionSignalId = this.connect('drag-motion', (function() {
+        });
+        let dragMotionSignalId = this.connect('drag-motion', () => {
             this.set_selected(false);
-        }).bind(this));
-        Utils.once(this.bubble, 'closed', (function() {
+        });
+        Utils.once(this.bubble, 'closed', () => {
             this._mapView.disconnect(markerSelectedSignalId);
             this._mapView.disconnect(goingToSignalId);
             this._view.disconnect(buttonPressSignalId);
@@ -274,7 +274,7 @@ var MapMarker = new Lang.Class({
 
             this._bubble.destroy();
             delete this._bubble;
-        }).bind(this));
+        });
     },
 
     _isInsideView: function() {
@@ -312,17 +312,12 @@ var MapMarker = new Lang.Class({
     },
 
     goTo: function(animate) {
-        Utils.once(this.walker, 'gone-to', (function() {
-            this.emit('gone-to');
-        }).bind(this));
-
+        Utils.once(this.walker, 'gone-to', () => { this.emit('gone-to'); });
         this.walker.goTo(animate);
     },
 
     goToAndSelect: function(animate) {
-        Utils.once(this, 'gone-to', (function() {
-            this.selected = true;
-        }).bind(this));
+        Utils.once(this, 'gone-to', () => { this.selected = true; });
 
         this.goTo(animate);
     },
diff --git a/src/mapSource.js b/src/mapSource.js
index 9f4c97b..430c99f 100644
--- a/src/mapSource.js
+++ b/src/mapSource.js
@@ -50,13 +50,8 @@ var AttributionLogo = new Lang.Class({
         else
             return;
 
-        view.connect('notify::width', (function() {
-            this._updatePosition(view);
-        }).bind(this));
-
-        view.connect('notify::height', (function() {
-            this._updatePosition(view);
-        }).bind(this));
+        view.connect('notify::width', () => { this._updatePosition(view); });
+        view.connect('notify::height', () => { this._updatePosition(view); });
 
         this._updatePosition(view);
     },
diff --git a/src/mapView.js b/src/mapView.js
index 2249889..02d9527 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -122,9 +122,9 @@ var MapView = new Lang.Class({
         let isValid = Application.routeQuery.isValid();
 
         this._routingOpen = value && isValid;
-        this._routeLayers.forEach((function(routeLayer) {
+        this._routeLayers.forEach((routeLayer) => {
             routeLayer.visible = value && isValid;
-        }).bind(this));
+        });
         this._instructionMarkerLayer.visible = value && isValid;
         if (!value)
             this.routeShowing = false;
@@ -153,7 +153,6 @@ var MapView = new Lang.Class({
 
         this.shapeLayerStore = new Gio.ListStore(GObject.TYPE_OBJECT);
 
-        this._updateUserLocation();
         Application.geoclue.connect('location-changed',
                                     this._updateUserLocation.bind(this));
         Application.geoclue.connect('notify::state',
@@ -191,11 +190,11 @@ var MapView = new Lang.Class({
             view.connect('notify::realized', this._goToStoredLocation.bind(this));
         view.connect('notify::latitude', this._onViewMoved.bind(this));
         // switching map type will set view min-zoom-level from map source
-        view.connect('notify::min-zoom-level', (function() {
+        view.connect('notify::min-zoom-level', () => {
             if (view.min_zoom_level < MapMinZoom) {
                 view.min_zoom_level = MapMinZoom;
             }
-        }).bind(this));
+        });
 
         this._initScale(view);
         return view;
@@ -224,11 +223,11 @@ var MapView = new Lang.Class({
     },
 
     _clearRouteLayers: function() {
-        this._routeLayers.forEach((function(routeLayer) {
+        this._routeLayers.forEach((routeLayer) => {
             routeLayer.remove_all();
             routeLayer.visible = false;
             this.view.remove_layer(routeLayer);
-        }).bind(this));
+        });
 
         this._routeLayers = [];
     },
@@ -265,34 +264,32 @@ var MapView = new Lang.Class({
         let transitPlan = Application.routingDelegator.openTripPlanner.plan;
         let query = Application.routeQuery;
 
-        route.connect('update', (function() {
+        route.connect('update', () => {
             this.showRoute(route);
             this.routeShowing = true;
-        }).bind(this));
-        route.connect('reset', (function() {
+        });
+        route.connect('reset', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
             this.routeShowing = false;
-        }).bind(this));
-        transitPlan.connect('update', this._showTransitPlan.bind(this, transitPlan));
-        transitPlan.connect('reset', (function() {
+        });
+        transitPlan.connect('update', () => { this._showTransitPlan(transitPlan); });
+        transitPlan.connect('reset', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
             this.routeShowing = false;
-        }).bind(this));
-        transitPlan.connect('itinerary-selected', (function(obj, itinerary) {
+        });
+        transitPlan.connect('itinerary-selected', (obj, itinerary) => {
             this._showTransitItinerary(itinerary);
             this.routeShowing = true;
-        }).bind(this));
-        transitPlan.connect('itinerary-deselected', (function() {
+        });
+        transitPlan.connect('itinerary-deselected', () => {
             this._clearRouteLayers();
             this._instructionMarkerLayer.remove_all();
             this.routeShowing = false;
-        }).bind(this));
+        });
 
-        query.connect('notify', (function() {
-                this.routingOpen = query.isValid();
-        }).bind(this));
+        query.connect('notify', () => { this.routingOpen = query.isValid(); });
     },
 
     setMapType: function(mapType) {
@@ -334,9 +331,9 @@ var MapView = new Lang.Class({
             }
         }
 
-        overlay_sources.forEach((function(source) {
+        overlay_sources.forEach((source) => {
             this.view.add_overlay_source(source, 255);
-        }).bind(this));
+        });
     },
 
     toggleScale: function() {
@@ -346,7 +343,7 @@ var MapView = new Lang.Class({
     openShapeLayers: function(files) {
         let bbox = new Champlain.BoundingBox();
         let ret = true;
-        files.forEach((function(file){
+        files.forEach((file) => {
             try {
                 let i = this._findShapeLayerIndex(file);
                 let layer = (i > -1) ? this.shapeLayerStore.get_item(i) : null;
@@ -364,7 +361,7 @@ var MapView = new Lang.Class({
                 Application.notificationManager.showMessage(msg);
                 ret = false;
             }
-        }).bind(this));
+        });
 
         this.gotoBBox(bbox);
         return ret;
@@ -407,9 +404,9 @@ var MapView = new Lang.Class({
             return;
 
         this.emit('going-to-user-location');
-        Utils.once(this._userLocation, "gone-to", (function() {
+        Utils.once(this._userLocation, "gone-to", () => {
             this.emit('gone-to-user-location');
-        }).bind(this));
+        });
         this._userLocation.goTo(animate);
     },
 
@@ -511,13 +508,13 @@ var MapView = new Lang.Class({
             return;
 
         this._placeLayer.remove_all();
-        places.forEach((function(p) {
+        places.forEach((p) => {
             let place = new ContactPlace.ContactPlace({ place: p,
                                                         contact: contact });
             let marker = new PlaceMarker.PlaceMarker({ place: place,
                                                        mapView: this });
             this._placeLayer.add_marker(marker);
-        }).bind(this));
+        });
 
         if (places.length > 1)
             this.gotoBBox(contact.bounding_box);
@@ -574,9 +571,7 @@ var MapView = new Lang.Class({
 
         routeLayer = this._createRouteLayer(false, TURN_BY_TURN_ROUTE_COLOR,
                                             ROUTE_LINE_WIDTH);
-        route.path.forEach((function (polyline) {
-            routeLayer.add_node(polyline);
-        }).bind(this));
+        route.path.forEach((polyline) => { routeLayer.add_node(polyline); });
         this.routingOpen = true;
 
         this._ensureInstructionLayerAboveRouteLayers();
@@ -591,7 +586,7 @@ var MapView = new Lang.Class({
         let pointIndex = 0;
 
         this._instructionMarkerLayer.remove_all();
-        route.turnPoints.forEach(function(turnPoint) {
+        route.turnPoints.forEach((turnPoint) => {
             if (turnPoint.isStop()) {
                 let queryPoint = query.filledPoints[pointIndex];
                 let destinationMarker = new TurnPointMarker.TurnPointMarker({ turnPoint: turnPoint,
@@ -609,7 +604,7 @@ var MapView = new Lang.Class({
         this._placeLayer.remove_all();
         this._instructionMarkerLayer.remove_all();
 
-        itinerary.legs.forEach((function (leg, index) {
+        itinerary.legs.forEach((leg, index) => {
             let dashed = !leg.transit;
             let color = leg.color;
             let outlineColor = leg.textColor;
@@ -653,11 +648,11 @@ var MapView = new Lang.Class({
 
                 routeLayer.add_node(firstPoint);
             }
-        }).bind(this));
+        });
 
         this._ensureInstructionLayerAboveRouteLayers();
 
-        itinerary.legs.forEach((function (leg, index) {
+        itinerary.legs.forEach((leg, index) => {
             let previousLeg = index === 0 ? null : itinerary.legs[index - 1];
 
             /* add start marker */
@@ -672,7 +667,7 @@ var MapView = new Lang.Class({
             }
 
             this._instructionMarkerLayer.add_marker(start);
-        }).bind(this));
+        });
 
         /* add arrival marker */
         let lastLeg = itinerary.legs.last();
@@ -692,10 +687,10 @@ var MapView = new Lang.Class({
         if (this._storeId !== 0)
             return;
 
-        this._storeId = Mainloop.timeout_add(_LOCATION_STORE_TIMEOUT,(function(){
+        this._storeId = Mainloop.timeout_add(_LOCATION_STORE_TIMEOUT, () => {
             this._storeId = 0;
             this._storeLocation();
-        }).bind(this));
+        });
     },
 
     onSetMarkerSelected: function(selectedMarker) {
diff --git a/src/mapWalker.js b/src/mapWalker.js
index 0cd3340..06a03ec 100644
--- a/src/mapWalker.js
+++ b/src/mapWalker.js
@@ -117,19 +117,17 @@ var MapWalker = new Lang.Class({
             this._view.goto_animation_mode = Clutter.AnimationMode.EASE_IN_CUBIC;
             this._ensureVisible(fromLocation);
 
-            Utils.once(this._view, 'animation-completed', (function() {
+            Utils.once(this._view, 'animation-completed', () => {
                 this._view.goto_animation_mode = Clutter.AnimationMode.EASE_OUT_CUBIC;
                 this._view.go_to(this.place.location.latitude,
                                  this.place.location.longitude);
 
-                Utils.once(this._view, 'animation-completed::go-to', (function() {
+                Utils.once(this._view, 'animation-completed::go-to', () => {
                     this.zoomToFit();
                     this._view.goto_animation_mode = Clutter.AnimationMode.EASE_IN_OUT_CUBIC;
                     this.emit('gone-to');
-                }).bind(this));
-
-            }).bind(this));
-
+                });
+            });
         }
     },
 
@@ -146,7 +144,7 @@ var MapWalker = new Lang.Class({
                                                      bottom:  90,
                                                      top:    -90 });
 
-            [fromLocation, this.place.location].forEach(function(location) {
+            [fromLocation, this.place.location].forEach((location) => {
                 visibleBox.left   = Math.min(visibleBox.left,   location.longitude);
                 visibleBox.right  = Math.max(visibleBox.right,  location.longitude);
                 visibleBox.bottom = Math.min(visibleBox.bottom, location.latitude);
diff --git a/src/notification.js b/src/notification.js
index 3eb64cc..e78a331 100644
--- a/src/notification.js
+++ b/src/notification.js
@@ -60,10 +60,10 @@ var Notification = new Lang.Class({
         // if there is an actual change in revealed state.
         if (state !== this.child_revealed) {
             this.set_reveal_child(state);
-            Mainloop.timeout_add(this.transition_duration, (function() {
+            Mainloop.timeout_add(this.transition_duration, () => {
                 this.emit(signal);
                 return false;
-            }).bind(this));
+            });
         }
     }
 });
diff --git a/src/notificationManager.js b/src/notificationManager.js
index ed622ac..ba2fae1 100644
--- a/src/notificationManager.js
+++ b/src/notificationManager.js
@@ -37,11 +37,11 @@ var NotificationManager = new Lang.Class({
     _add: function(notification) {
         this._current = notification;
         if (!(notification instanceof Notification.Plain)) {
-            let dismissId = notification.connect('dismissed', (function() {
+            let dismissId = notification.connect('dismissed', () => {
                 this._overlay.remove(notification);
                 notification.disconnect(dismissId);
                 this._current = null;
-            }).bind(this));
+            });
         }
         this._overlay.add_overlay(notification);
         Mainloop.timeout_add(_TIMEOUT, notification.dismiss.bind(notification));
@@ -50,10 +50,10 @@ var NotificationManager = new Lang.Class({
 
     showMessage: function (msg) {
         let notification = new Notification.Plain(msg);
-        notification.connect('dismissed', (function() {
+        notification.connect('dismissed', () => {
             this._current = null;
             notification.destroy();
-        }).bind(this));
+        });
         this.showNotification(notification);
     },
 
diff --git a/src/openTripPlanner.js b/src/openTripPlanner.js
index e0d209b..58254b8 100644
--- a/src/openTripPlanner.js
+++ b/src/openTripPlanner.js
@@ -195,7 +195,7 @@ var OpenTripPlanner = new Lang.Class({
             let request = new Soup.Message({ method: 'GET', uri: uri });
 
             request.request_headers.append('Accept', 'application/json');
-            this._session.queue_message(request, (function(obj, message) {
+            this._session.queue_message(request, (obj, message) => {
                 if (message.status_code !== Soup.Status.OK) {
                     callback(false);
                     return;
@@ -209,14 +209,14 @@ var OpenTripPlanner = new Lang.Class({
                     Utils.debug('Failed to parse router information');
                     callback(false);
                 }
-            }).bind(this));
+            });
         }
     },
 
     _getRoutersForPlace: function(place) {
         let routers = [];
 
-        this._routers.routerInfo.forEach((function(routerInfo) {
+        this._routers.routerInfo.forEach((routerInfo) => {
             /* TODO: only check bounding rectangle for now
              * should we try to do a finer-grained check using the bounding
              * polygon (if OTP gives one for the routers).
@@ -228,7 +228,7 @@ var OpenTripPlanner = new Lang.Class({
                 place.location.longitude >= routerInfo.lowerLeftLongitude &&
                 place.location.longitude <= routerInfo.upperRightLongitude)
                 routers.push(routerInfo.routerId);
-        }));
+        });
 
         return routers;
     },
@@ -261,9 +261,9 @@ var OpenTripPlanner = new Lang.Class({
     },
 
     _getModes: function(options) {
-        let modes = options.transitTypes.map((function(transitType) {
+        let modes = options.transitTypes.map((transitType) => {
             return this._getMode(transitType);
-        }).bind(this));
+        });
 
         return modes.join(',');
     },
@@ -282,21 +282,21 @@ var OpenTripPlanner = new Lang.Class({
                                               callback);
             } else if (stopIndex === 0) {
                 this._fetchWalkingRoute([points[0], stopPoint],
-                                        (function(route) {
+                                        (route) => {
                     /* if we couldn't find an exact walking route, go with the
                      * "as the crow flies" distance */
                     if (route)
                         stop.dist = route.distance;
                     this._selectBestStopRecursive(stops, index + 1, stopIndex,
                                                   callback);
-                }).bind(this));
+                });
             } else if (stopIndex === points.length - 1) {
-                this._fetchWalkingRoute([stopPoint, points.last()], (function(route) {
+                this._fetchWalkingRoute([stopPoint, points.last()], (route) => {
                     if (route)
                         stop.dist = route.distance;
                     this._selectBestStopRecursive(stops, index + 1, stopIndex,
                                                   callback);
-                }).bind(this));
+                });
             } else {
                 /* for intermediate stops just return the one geographically
                  * closest */
@@ -308,9 +308,7 @@ var OpenTripPlanner = new Lang.Class({
              * distances */
             stops.sort(this._sortTransitStops);
             Utils.debug('refined stops: ');
-            stops.forEach(function(stop) {
-                Utils.debug(JSON.stringify(stop, '', 2));
-            });
+            stops.forEach((stop) => { Utils.debug(JSON.stringify(stop, '', 2)); });
             callback(stops[0]);
         }
     },
@@ -333,7 +331,7 @@ var OpenTripPlanner = new Lang.Class({
         let request = new Soup.Message({ method: 'GET', uri: uri });
 
         request.request_headers.append('Accept', 'application/json');
-        this._session.queue_message(request, (function(obj, message) {
+        this._session.queue_message(request, (obj, message) => {
             if (message.status_code !== Soup.Status.OK) {
                 Utils.debug('Failed to get routes for stop');
                 this._reset();
@@ -343,7 +341,7 @@ var OpenTripPlanner = new Lang.Class({
                 Utils.debug('Routes for stop: ' + stop + ': ' + JSON.stringify(routes));
                 callback(routes);
             }
-        }).bind(this));
+        });
     },
 
     _routeMatchesSelectedModes: function(route) {
@@ -372,7 +370,7 @@ var OpenTripPlanner = new Lang.Class({
         if (index < stops.length) {
             let stop = stops[index];
 
-            this._fetchRoutesForStop(router, stop, (function(routes) {
+            this._fetchRoutesForStop(router, stop, (routes) => {
                 for (let i = 0; i < routes.length; i++) {
                     let route = routes[i];
 
@@ -383,7 +381,7 @@ var OpenTripPlanner = new Lang.Class({
                 }
                 this._filterStopsRecursive(router, stops, index + 1,
                                            filteredStops, callback);
-            }).bind(this));
+            });
         } else {
             callback(filteredStops);
         }
@@ -407,7 +405,7 @@ var OpenTripPlanner = new Lang.Class({
             let request = new Soup.Message({ method: 'GET', uri: uri });
 
             request.request_headers.append('Accept', 'application/json');
-            this._session.queue_message(request, (function(obj, message) {
+            this._session.queue_message(request, (obj, message) => {
                 if (message.status_code !== Soup.Status.OK) {
                     Utils.debug('Failed to get stop for search point ' + point);
                     this._reset();
@@ -425,13 +423,13 @@ var OpenTripPlanner = new Lang.Class({
                         stops = stops.splice(0, NUM_STOPS_TO_TRY);
 
                         Utils.debug('stops: ' + JSON.stringify(stops, '', 2));
-                        this._selectBestStop(stops, index, (function(stop) {
+                        this._selectBestStop(stops, index, (stop) => {
                             result.push(stop);
                             this._fetchTransitStopsRecursive(router, index + 1,
                                                              result, callback);
-                        }).bind(this));
+                        });
                     } else {
-                        this._filterStops(router, stops, (function(filteredStops) {
+                        this._filterStops(router, stops, (filteredStops) => {
                             filteredStops.sort(this._sortTransitStops);
                             filteredStops = filteredStops.splice(0, NUM_STOPS_TO_TRY);
 
@@ -441,15 +439,15 @@ var OpenTripPlanner = new Lang.Class({
                                 return;
                             }
 
-                            this._selectBestStop(filteredStops, index, (function(stop) {
+                            this._selectBestStop(filteredStops, index, (stop) => {
                                 result.push(stop);
                                 this._fetchTransitStopsRecursive(router, index + 1,
                                                                  result, callback);
-                            }).bind(this));
-                        }).bind(this));
+                            });
+                        });
                     }
                 }
-            }).bind(this));
+            });
         } else {
             callback(result);
         }
@@ -544,7 +542,7 @@ var OpenTripPlanner = new Lang.Class({
     },
 
     _fetchRoutesForRouter: function(router, callback) {
-        this._fetchTransitStops(router, (function(stops) {
+        this._fetchTransitStops(router, (stops) => {
             let points = this._query.filledPoints;
 
             if (!stops) {
@@ -570,7 +568,7 @@ var OpenTripPlanner = new Lang.Class({
             let request = new Soup.Message({ method: 'GET', uri: uri });
 
             request.request_headers.append('Accept', 'application/json');
-            this._session.queue_message(request, (function(obj, message) {
+            this._session.queue_message(request, (obj, message) => {
                 if (message.status_code !== Soup.Status.OK) {
                     Utils.debug('Failed to get route plan from router ' +
                                 routers[index] + ' ' + message);
@@ -578,22 +576,22 @@ var OpenTripPlanner = new Lang.Class({
                 } else {
                     callback(JSON.parse(message.response_body.data));
                 }
-            }).bind(this));
-        }).bind(this));
+            });
+        });
     },
 
     _fetchRoutesRecursive: function(routers, index, result, callback) {
         if (index < routers.length) {
             let router = routers[index];
 
-            this._fetchRoutesForRouter(router, (function(response) {
+            this._fetchRoutesForRouter(router, (response) => {
                 if (response) {
                     Utils.debug('plan: ' + JSON.stringify(response, '', 2));
                     result.push(response);
                 }
 
                 this._fetchRoutesRecursive(routers, index + 1, result, callback);
-            }).bind(this));
+            });
         } else {
             callback(result);
         }
@@ -631,21 +629,21 @@ var OpenTripPlanner = new Lang.Class({
     },
 
     _fetchRoute: function() {
-        this._fetchRouters((function(success) {
+        this._fetchRouters((success) => {
             if (success) {
                 let points = this._query.filledPoints;
                 let routers = this._getRoutersForPoints(points);
 
                 if (routers.length > 0) {
-                    this._fetchRoutes(routers, (function(routes) {
+                    this._fetchRoutes(routers, (routes) => {
                         let itineraries = [];
-                        routes.forEach((function(plan) {
+                        routes.forEach((plan) => {
                             if (plan.plan && plan.plan.itineraries) {
                                 itineraries =
                                     itineraries.concat(
                                         this._createItineraries(plan.plan.itineraries));
                             }
-                        }).bind(this));
+                        });
 
                         if (itineraries.length === 0) {
                             /* don't reset query points, unlike for turn-based
@@ -655,7 +653,7 @@ var OpenTripPlanner = new Lang.Class({
                         } else {
                             this._recalculateItineraries(itineraries);
                         }
-                    }).bind(this));
+                    });
 
                 } else {
                     Application.notificationManager.showMessage(_("No timetable data found for this 
route."));
@@ -665,7 +663,7 @@ var OpenTripPlanner = new Lang.Class({
                 Application.notificationManager.showMessage(_("Route request failed."));
                 this._reset();
             }
-        }).bind(this));
+        });
     },
 
     _isOnlyWalkingItinerary: function(itinerary) {
@@ -676,10 +674,10 @@ var OpenTripPlanner = new Lang.Class({
         // filter out itineraries with only walking
         let newItineraries = [];
 
-        itineraries.forEach((function(itinerary) {
+        itineraries.forEach((itinerary) => {
             if (!this._isOnlyWalkingItinerary(itinerary))
                 newItineraries.push(itinerary);
-        }).bind(this));
+        });
 
         /* TODO: should we always calculate a walking itinerary to put at the
          * top if the total distance is below some threashhold?
@@ -717,10 +715,10 @@ var OpenTripPlanner = new Lang.Class({
 
     _recalculateItinerariesRecursive: function(itineraries, index) {
         if (index < itineraries.length) {
-            this._recalculateItinerary(itineraries[index], (function(itinerary) {
+            this._recalculateItinerary(itineraries[index], (itinerary) => {
                 itineraries[index] = itinerary;
                 this._recalculateItinerariesRecursive(itineraries, index + 1);
-            }).bind(this));
+            });
         } else {
             /* filter out itineraries where there are intermediate walking legs
              * that are too narrow time-wise, this is nessesary since running
@@ -732,16 +730,14 @@ var OpenTripPlanner = new Lang.Class({
              */
             let filteredItineraries = [];
 
-            itineraries.forEach((function(itinerary) {
+            itineraries.forEach((itinerary) => {
                 if (this._isItineraryRealistic(itinerary) &&
                     !this._isOnlyWalkingItinerary(itinerary))
                     filteredItineraries.push(itinerary);
-            }).bind(this));
+            });
 
             if (filteredItineraries.length > 0) {
-                filteredItineraries.forEach((function(itinerary) {
-                    itinerary.adjustTimings();
-                }).bind(this));
+                filteredItineraries.forEach((itinerary) => { itinerary.adjustTimings(); });
 
                 /* sort itineraries, by departure time ascending if querying
                  * by leaving time, by arrival time descending when querying
@@ -815,11 +811,10 @@ var OpenTripPlanner = new Lang.Class({
         if (!route) {
             this._graphHopper.fetchRouteAsync(points,
                                               RouteQuery.Transportation.PEDESTRIAN,
-                                              (function(newRoute)
-            {
+                                              (newRoute) => {
                 this._walkingRoutes[index] = newRoute;
                 callback(newRoute);
-            }).bind(this));
+            });
         } else {
             callback(route);
         }
@@ -834,7 +829,7 @@ var OpenTripPlanner = new Lang.Class({
              * leg is a non-transit (walking), recalculate the route in its entire
              * using walking
              */
-            this._fetchWalkingRoute(this._query.filledPoints, (function(route) {
+            this._fetchWalkingRoute(this._query.filledPoints, (route) => {
                 let leg = this._createWalkingLeg(from, to, from.place.name,
                                                  to.place.name, route);
                 let newItinerary =
@@ -842,7 +837,7 @@ var OpenTripPlanner = new Lang.Class({
                                                duration: route.time / 1000,
                                                legs: [leg]});
                 callback(newItinerary);
-            }).bind(this));
+            });
         } else if (itinerary.legs.length === 1 && itinerary.legs[0].transit) {
             // special case if there is extactly one transit leg
             let leg = itinerary.legs[0];
@@ -860,28 +855,28 @@ var OpenTripPlanner = new Lang.Class({
                 /* add an extra walking leg to both the beginning and end of the
                  * itinerary
                  */
-                this._fetchWalkingRoute([from, startLeg], (function(firstRoute) {
+                this._fetchWalkingRoute([from, startLeg], (firstRoute) => {
                     let firstLeg =
                         this._createWalkingLeg(from, startLeg, from.place.name,
                                                leg.from, firstRoute);
-                    this._fetchWalkingRoute([endLeg, to], (function(lastRoute) {
+                    this._fetchWalkingRoute([endLeg, to], (lastRoute) => {
                         let lastLeg = this._createWalkingLeg(endLeg, to, leg.to,
                                                              to.place.name,
                                                              lastRoute);
                         itinerary.legs.unshift(firstLeg);
                         itinerary.legs.push(lastLeg);
                         callback(itinerary);
-                    }).bind(this));
-                }).bind(this));
+                    });
+                });
             } else if (endWalkDistance >= MIN_WALK_ROUTING_DISTANCE) {
                 // add an extra walking leg to the end of the itinerary
-                this._fetchWalkingRoute([endLeg, to], (function(lastRoute) {
+                this._fetchWalkingRoute([endLeg, to], (lastRoute) => {
                     let lastLeg =
                         this._createWalkingLeg(endLeg, to, leg.to,
                                                to.place.name, lastRoute);
                     itinerary.legs.push(lastLeg);
                     callback(itinerary);
-                }).bind(this));
+                });
             } else {
                 /* if only there's only a walking leg to be added to the start
                  * let the recursive routine dealing with multi-leg itineraries
@@ -955,14 +950,14 @@ var OpenTripPlanner = new Lang.Class({
                         itinerary.legs.splice(index + 1, index + 1);
                     }
 
-                    this._fetchWalkingRoute([from, to], (function(route) {
+                    this._fetchWalkingRoute([from, to], (route) => {
                         let newLeg =
                             this._createWalkingLeg(from, to, from.place.name,
                                                    toName, route);
                         itinerary.legs[index] = newLeg;
                         this._recalculateItineraryRecursive(itinerary, index + 1,
                                                             callback);
-                    }).bind(this));
+                    });
                 } else {
                     /* introduce an additional walking leg calculated
                      * by GH in case the OTP starting point as far enough from
@@ -974,7 +969,7 @@ var OpenTripPlanner = new Lang.Class({
                     let distance = fromLoc.get_distance_from(toLoc) * 1000;
 
                     if (distance >= MIN_WALK_ROUTING_DISTANCE) {
-                        this._fetchWalkingRoute([from, to], (function(route) {
+                        this._fetchWalkingRoute([from, to], (route) => {
                             let newLeg =
                                 this._createWalkingLeg(from, to, from.place.name,
                                                        leg.from, route);
@@ -985,7 +980,7 @@ var OpenTripPlanner = new Lang.Class({
                             this._recalculateItineraryRecursive(itinerary,
                                                                 index + 2,
                                                                 callback);
-                        }).bind(this));
+                        });
                     } else {
                         this._recalculateItineraryRecursive(itinerary, index + 1,
                                                             callback);
@@ -1035,7 +1030,7 @@ var OpenTripPlanner = new Lang.Class({
                         insertIndex = index;
                     }
                     let from = this._createQueryPointForCoord(finalTransitLeg.fromCoordinate);
-                    this._fetchWalkingRoute([from, to], (function(route) {
+                    this._fetchWalkingRoute([from, to], (route) => {
                         let newLeg =
                             this._createWalkingLeg(from, to,
                                                    finalTransitLeg.from,
@@ -1044,7 +1039,7 @@ var OpenTripPlanner = new Lang.Class({
                         this._recalculateItineraryRecursive(itinerary,
                                                             insertIndex + 1,
                                                             callback);
-                    }).bind(this));
+                    });
                 } else {
                     /* introduce an additional walking leg calculated by GH in
                      * case the OTP end point as far enough from the original
@@ -1056,7 +1051,7 @@ var OpenTripPlanner = new Lang.Class({
                     let distance = fromLoc.get_distance_from(toLoc) * 1000;
 
                     if (distance >= MIN_WALK_ROUTING_DISTANCE) {
-                        this._fetchWalkingRoute([from, to], (function(route) {
+                        this._fetchWalkingRoute([from, to], (route) => {
                             let newLeg =
                                 this._createWalkingLeg(from, to, leg.to,
                                                        to.place.name, route);
@@ -1067,7 +1062,7 @@ var OpenTripPlanner = new Lang.Class({
                             this._recalculateItineraryRecursive(itinerary,
                                                                  index + 2,
                                                                  callback);
-                        }).bind(this));
+                        });
                     } else {
                         this._recalculateItineraryRecursive(itinerary, index + 1,
                                                             callback);
@@ -1092,14 +1087,14 @@ var OpenTripPlanner = new Lang.Class({
                         itinerary.legs.splice(index + 1, index + 1);
                     }
 
-                    this._fetchWalkingRoute([from, to], (function(route) {
+                    this._fetchWalkingRoute([from, to], (route) => {
                         let newLeg = this._createWalkingLeg(from, to, leg.from,
                                                             leg.to, route);
                         itinerary.legs[index] = newLeg;
                         this._recalculateItineraryRecursive(itinerary,
                                                             index + 1,
                                                             callback);
-                    }).bind(this));
+                    });
                 } else {
                     this._recalculateItineraryRecursive(itinerary, index + 1,
                                                         callback);
@@ -1122,9 +1117,7 @@ var OpenTripPlanner = new Lang.Class({
     },
 
     _createItineraries: function(itineraries) {
-        return itineraries.map((function(itinerary) {
-                                    return this._createItinerary(itinerary);
-                                }).bind(this));
+        return itineraries.map((itinerary) => { return this._createItinerary(itinerary); });
     },
 
     _createItinerary: function(itinerary) {
@@ -1137,9 +1130,7 @@ var OpenTripPlanner = new Lang.Class({
     },
 
     _createLegs: function(legs) {
-        return legs.map((function(leg) {
-            return this._createLeg(leg);
-        }).bind(this));
+        return legs.map((leg) => { return this._createLeg(leg); });
     },
 
     /* check if a string is a valid hex RGB string */
@@ -1197,9 +1188,7 @@ var OpenTripPlanner = new Lang.Class({
 
     _createIntermediateStops: function(leg) {
         let stops = leg.intermediateStops;
-        return stops.map((function(stop) {
-            return this._createIntermediateStop(stop, leg);
-        }).bind(this));
+        return stops.map((stop) => { return this._createIntermediateStop(stop, leg); });
     },
 
     _createIntermediateStop: function(stop, leg) {


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