summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Danielsson <jonas@threetimestwo.org>2015-08-16 12:54:09 +0200
committerJonas Danielsson <jonas@threetimestwo.org>2015-08-16 12:54:14 +0200
commit66a033d98c3a7329f25c89dbf9d8f50c064981c6 (patch)
treefe5e8a620a5d90c2ea0de272ef27a1217580ed90
parente853547e95756212152e473d6db6ef24ab6f3fb5 (diff)
downloadgnome-maps-66a033d98c3a7329f25c89dbf9d8f50c064981c6.tar.gz
placeEntry: Add support for geo URI input
Add support for entering Geo URIs (RFC 5870) in the search bar. Example: geo:37.7869,-122.3997
-rw-r--r--src/placeEntry.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/placeEntry.js b/src/placeEntry.js
index 5018a3fb..6e3dbdd6 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -195,6 +195,20 @@ const PlaceEntry = new Lang.Class({
return true;
}
+ if (this.text.startsWith('geo:')) {
+ let location = new Geocode.Location();
+
+ try {
+ location.set_from_uri(this.text);
+ this.place = new Place.Place({ location: location });
+ } catch(e) {
+ let msg = _("Failed to parse Geo URI");
+ Application.notificationManager.showMessage(msg);
+ }
+
+ return true;
+ }
+
let parsedLocation = this._parseCoordinates(this.text);
if (parsedLocation) {
this.place = new Place.Place({ location: parsedLocation });