Skip to content

Commit

Permalink
fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
mcguffin committed Feb 9, 2019
1 parent 7e2a526 commit 72321cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions etc/leaflet-providers.json
Expand Up @@ -8,7 +8,7 @@
"variants": {
"Mapnik": {},
"BlackAndWhite": {
"url": "http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",
"url": "https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",
"options": {
"maxZoom": 18
}
Expand Down Expand Up @@ -498,7 +498,7 @@
}
},
"HikeBike": {
"url": "http://{s}.tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png",
"url": "https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png",
"options": {
"maxZoom": 19,
"attribution": "{attribution.OpenStreetMap}",
Expand Down
8 changes: 8 additions & 0 deletions gulpfile.js
Expand Up @@ -67,6 +67,14 @@ L = {
gulp.task('providers', function(cb){
require('./node_modules/leaflet-providers/leaflet-providers.js');
var providers = L.TileLayer.Provider.providers;

// patch insecure map tile URLs
if ( providers.OpenStreetMap.variants.BlackAndWhite.url.indexOf('http:') === 0 ) {
providers.OpenStreetMap.variants.BlackAndWhite.url = "https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png";
}
if ( providers.HikeBike.url.indexOf('http:') === 0 ) {
providers.HikeBike.url = "https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png"
}
return fs.writeFile( './etc/leaflet-providers.json', JSON.stringify( providers, null, '\t' ), cb );
});

Expand Down

0 comments on commit 72321cf

Please sign in to comment.