mercredi 9 septembre 2015

http://{s}.tile.osm.org/{z}/{x}/{y}.png ERR_INSECURE_RESPONSE

If you use Leaflet (http://leafletjs.com) inside a HTTPS page and you would like to access to the OpenStreetMap tiles like that : 
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

You must do that :

L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

OpenStreetMap  doesn't have a certificate for the abbreviated domain osm.org




Source : https://github.com/Leaflet/Leaflet/issues/3186

Categories