summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2019-07-08 19:20:28 +0200
committerMarcus Lundblad <ml@update.uu.se>2019-07-09 22:46:30 +0200
commit84714eaa9c529bf657f4a86b79585676f50e0b14 (patch)
treed2d441518c78061184303dba0a12401557f9bbce
parent12d1745c5bca053d85a484b7a94e2d1148ad512a (diff)
downloadgnome-maps-wip/mlundblad/handle-osm-urls.tar.gz
application: Handle http(s) URLswip/mlundblad/handle-osm-urls
Handle opening a specific subset of HTTP URLs.
-rw-r--r--src/application.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/application.js b/src/application.js
index f9d9bdac..58d15c33 100644
--- a/src/application.js
+++ b/src/application.js
@@ -280,11 +280,14 @@ var Application = GObject.registerClass({
return;
let uri = files[0].get_uri();
+ let scheme = GLib.uri_parse_scheme(uri);
- if (GLib.uri_parse_scheme(uri) === 'geo') {
+ if (scheme === 'geo') {
/* we get an uri that looks like geo:///lat,lon, remove slashes */
let geoURI = uri.replace(/\//g, '');
this._mainWindow.mapView.goToGeoURI(geoURI);
+ } else if (scheme === 'http' || scheme === 'https') {
+ this._mainWindow.mapView.goToHttpURL(uri);
} else {
this._mainWindow.mapView.openShapeLayers(files);
}