Skip to content

Commit

Permalink
Support https in geocoder
Browse files Browse the repository at this point in the history
This brings OSMGeocoder up to date with the original at
https://github.com/k4r573n/leaflet-control-osm-geocoder
This patch prevents 'locate' from throwing a "Blocked
loading mixed active content" in firefox when using https.

Fixes issue emijrp#7
  • Loading branch information
lokal-profil committed Sep 7, 2014
1 parent a4c344e commit f93dce3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions leaflet/Control.OSMGeocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ L.Control.OSMGeocoder = L.Control.extend({
},
_isLatLon_decMin : function (q) {
console.log("is LatLon?: "+q);
//N 53° 13.785' E 010° 23.887'
//N 53° 13.785' E 010° 23.887'
//re = /[NS]\s*(\d+)\D*(\d+\.\d+).?\s*[EW]\s*(\d+)\D*(\d+\.\d+)\D*/;
re = /([ns])\s*(\d+)\D*(\d+\.\d+).?\s*([ew])\s*(\d+)\D*(\d+\.\d+)/i;
m = re.exec(q.toLowerCase());
Expand Down Expand Up @@ -171,7 +171,8 @@ L.Control.OSMGeocoder = L.Control.extend({
}
}

var url = " http://nominatim.openstreetmap.org/search" + L.Util.getParamString(params),
var protocol = location.protocol;
var url = protocol + "//nominatim.openstreetmap.org/search" + L.Util.getParamString(params),
script = document.createElement("script");


Expand Down

0 comments on commit f93dce3

Please sign in to comment.