[gnome-maps] mapView: Add gotoBBox helper
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] mapView: Add gotoBBox helper
- Date: Sat, 31 Jan 2015 23:49:28 +0000 (UTC)
commit 107f5ae3ca004676dc72381e0e151c7199854ae2
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Tue Dec 16 04:34:15 2014 -0500
mapView: Add gotoBBox helper
https://bugzilla.gnome.org/show_bug.cgi?id=741591
src/mapView.js | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 1b3f5a7..46ecbea 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -190,6 +190,19 @@ const MapView = new Lang.Class({
this.emit('user-location-changed');
},
+ _gotoBBox: function(bbox) {
+ let [lat, lon] = bbox.get_center();
+ let place = new Place.Place({
+ location: new Geocode.Location({ latitude : lat,
+ longitude : lon }),
+ bounding_box: new Geocode.BoundingBox({ top : bbox.top,
+ bottom : bbox.bottom,
+ left : bbox.left,
+ right : bbox.right })
+ });
+ new MapWalker.MapWalker(place, this).goTo(true);
+ },
+
showTurnPoint: function(turnPoint) {
if (this._turnPointMarker)
this._turnPointMarker.destroy();
@@ -220,18 +233,8 @@ const MapView = new Lang.Class({
route.path.forEach(this._routeLayer.add_node.bind(this._routeLayer));
- let [lat, lon] = route.bbox.get_center();
- let place = new Place.Place({
- location : new Geocode.Location({ latitude : lat,
- longitude : lon }),
- bounding_box : new Geocode.BoundingBox({ top : route.bbox.top,
- bottom : route.bbox.bottom,
- left : route.bbox.left,
- right : route.bbox.right })
- });
-
this._showDestinationTurnpoints();
- new MapWalker.MapWalker(place, this).goTo(true);
+ this._gotoBBox(route.bbox);
},
_showDestinationTurnpoints: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]