Skip to content

Commit

Permalink
Https instead of http requests to fix 'Mixed Content' issue
Browse files Browse the repository at this point in the history
modified:   lib/activeadmin/views/openstreetmap_proxy.rb
modified:   lib/activeadmin/views/templates/openstreetmap.html.erb
  • Loading branch information
Hossam-Hawary committed Apr 14, 2019
1 parent 4d76bb6 commit c9fd017
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/activeadmin/views/openstreetmap_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class OpenStreetMapProxy < LatlngProxy
def build(_, *args, &_block)
super _, *args, &_block
@template_name = 'openstreetmap.html.erb'
@script_html = '<script src="http://cdnjs.buttflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>'
@script_html = '<script src="https://cdnjs.buttflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>'
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/activeadmin/views/templates/openstreetmap.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li>
<%= loading_map_code %>
<link rel="stylesheet" href="http://cdnjs.buttflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.buttflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<script>
var osmObject = {
idLat: '<%= id_lat %>',
Expand All @@ -18,8 +18,8 @@
console.log(e);
}

var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 20, attribution: osmAttrib});

osmObject.map.setView([lat, lon],10);
Expand Down Expand Up @@ -71,7 +71,7 @@
},

searchLocation: function(text, callback) {
var requestUrl = "http://nominatim.openstreetmap.org/search?format=json&q="+text;
var requestUrl = "https://nominatim.openstreetmap.org/search?format=json&q="+text;
$.ajax({
url: requestUrl,
type: "GET",
Expand Down

0 comments on commit c9fd017

Please sign in to comment.