summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Danielsson <jonas@threetimestwo.org>2015-10-09 21:07:14 +0200
committerJonas Danielsson <jonas@threetimestwo.org>2015-10-09 21:08:24 +0200
commit268627936e0fa0bd1bba94ab193c61133544c5e8 (patch)
tree75f624d66dea4f3a9383030242227d21ac1c26f5
parent91427630d1b528d0ef3435aae16d56135843e484 (diff)
downloadgnome-maps-268627936e0fa0bd1bba94ab193c61133544c5e8.tar.gz
Improve showing of contact
Do not travel to a contacts bounding box if the contact only has one address.
-rw-r--r--lib/maps-contact-store.c2
-rw-r--r--src/application.js4
-rw-r--r--src/mapView.js5
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/maps-contact-store.c b/lib/maps-contact-store.c
index 036d8bc2..168d1754 100644
--- a/lib/maps-contact-store.c
+++ b/lib/maps-contact-store.c
@@ -173,7 +173,7 @@ get_contact (FolksIndividual *individual)
name = g_strdup_printf ("%s (%s)",
folks_individual_get_display_name (individual),
type);
- place = geocode_place_new (name, GEOCODE_PLACE_TYPE_UNKNOWN);
+ place = geocode_place_new (name, GEOCODE_PLACE_TYPE_STREET);
g_free (name);
geocode_place_set_country (place,
diff --git a/src/application.js b/src/application.js
index 0f583b20..2a6ca2cf 100644
--- a/src/application.js
+++ b/src/application.js
@@ -114,6 +114,10 @@ const Application = new Lang.Class({
_showContact: function(id) {
contactStore.lookup(id, (function(contact) {
this._mainWindow.markBusy();
+ if (!contact) {
+ this._mainWindow.unmarkBusy();
+ return;
+ }
contact.geocode((function() {
this._mainWindow.unmarkBusy();
this._mainWindow.mapView.showContact(contact);
diff --git a/src/mapView.js b/src/mapView.js
index c37023ea..185db2f5 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -261,7 +261,10 @@ const MapView = new Lang.Class({
this._placeLayer.add_marker(marker);
}).bind(this));
- this._gotoBBox(contact.bounding_box);
+ if (places.length > 1)
+ this._gotoBBox(contact.bounding_box);
+ else
+ new MapWalker.MapWalker(places[0], this).goTo(true);
},
_showStoredRoute: function(stored) {