[gnome-maps/wip/mlundblad/handle-osm-urls: 4/4] application: Handle http(s) URLs



commit 84714eaa9c529bf657f4a86b79585676f50e0b14
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Jul 8 19:20:28 2019 +0200

    application: Handle http(s) URLs
    
    Handle opening a specific subset of
    HTTP URLs.

 src/application.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/application.js b/src/application.js
index f9d9bda..58d15c3 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);
         }


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