From 77fee91785af7630f608c41041cf4eeed6eeb369 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 18 Feb 2017 12:08:58 +0000 Subject: [PATCH] Preserve protocol in short links --- app/assets/javascripts/leaflet.map.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 4b50cc78c..1edb1ae4b 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -121,7 +121,8 @@ L.OSM.Map = L.Map.extend({ var zoom = this.getZoom(), latLng = marker && this.hasLayer(marker) ? marker.getLatLng().wrap() : this.getCenter().wrap(), str = window.location.hostname.match(/^www\.openstreetmap\.org/i) ? - 'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/', + window.location.protocol + '://osm.org/go/' : + window.location.protocol + '://' + window.location.hostname + '/go/', char_array = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_~", x = Math.round((latLng.lng + 180.0) * ((1 << 30) / 90.0)), y = Math.round((latLng.lat + 90.0) * ((1 << 30) / 45.0)), -- 2.43.2