diff --git a/examples/geoJSON/main.js b/examples/geoJSON/main.js
index e624d8765d..43cac8ccfe 100644
--- a/examples/geoJSON/main.js
+++ b/examples/geoJSON/main.js
@@ -19,8 +19,8 @@ $(function () {
url: 'http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png',
attribution: ['Map tiles by Stamen Design,',
'under CC BY 3.0.',
- 'Data by OpenStreetMap, under',
- 'ODbL.'
+ 'Data by OpenStreetMap, under',
+ 'ODbL.'
].join(' ')
}
);
diff --git a/examples/lines/main.js b/examples/lines/main.js
index eddcde5c4b..9cae11654f 100644
--- a/examples/lines/main.js
+++ b/examples/lines/main.js
@@ -330,7 +330,7 @@ $(function () {
}
// Create a tile layer
- osm = map.createLayer('osm');
+ osm = map.createLayer('osm', {url: query.url || undefined});
set_osm_url(query.showmap);
// Create a feature layer for the lines
layer = map.createLayer('feature', layerOptions);
diff --git a/examples/osm/main.js b/examples/osm/main.js
index a6a2960897..78ad9c3c63 100644
--- a/examples/osm/main.js
+++ b/examples/osm/main.js
@@ -19,8 +19,8 @@ $(function () {
url: 'http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png',
attribution: ['Map tiles by Stamen Design,',
'under CC BY 3.0.',
- 'Data by OpenStreetMap, under',
- 'ODbL.'
+ 'Data by OpenStreetMap, under',
+ 'ODbL.'
].join(' ')
}
);
diff --git a/examples/reprojection/index.pug b/examples/reprojection/index.pug
index c9a9d9639c..73510810b2 100644
--- a/examples/reprojection/index.pug
+++ b/examples/reprojection/index.pug
@@ -4,10 +4,10 @@ block append mainContent
#controls
.form-group(title="The url used to fetch tiles. Use {x}, {y}, {z}, and {s} for templating.")
label(for="layer-url") Tile URL
- select#layer-url.layerparam(param-name="url", list="url-list", placeholder="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
- option(value="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", credit="© OpenStreetMap contributors") OpenStreetMap
+ select#layer-url.layerparam(param-name="url", list="url-list", placeholder="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
+ option(value="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", credit="© OpenStreetMap contributors") OpenStreetMap
option(value="../../data/tilefancy.png", credit="") Fancy Test Tile
- option(value="http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png", credit='Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.') Toner Lite
+ option(value="http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png", credit='Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.') Toner Lite
.form-group(title="Web maps are most often rendered using a Mercator geographic coordinate system, but other projections can be used. See spatialreference.org for more information on projections.")
label(for="map-gcs") Map GCS
select#map-gcs.mapparam(param-name="gcs", placeholder="EPSG:3857 - Web Mercator", reload="true")
diff --git a/examples/reprojection/main.js b/examples/reprojection/main.js
index b3c3cba10e..ebe82c5c9d 100644
--- a/examples/reprojection/main.js
+++ b/examples/reprojection/main.js
@@ -140,7 +140,7 @@ $(function () {
if (query.url) {
layerParams.url = query.url;
} else {
- layerParams.url = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ layerParams.url = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
}
// Create a map object
var map = geo.map(mapParams);
diff --git a/examples/tiles/index.pug b/examples/tiles/index.pug
index 2912f71ddb..a0de4d3d67 100644
--- a/examples/tiles/index.pug
+++ b/examples/tiles/index.pug
@@ -56,11 +56,11 @@ block append mainContent
.form-group(title="The url used to fetch tiles. Use {x}, {y}, {z}, and {s} for templating.")
label(for="layer-url") Tile URL
- input#layer-url.layerparam(param-name="url", list="url-list", placeholder="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
+ input#layer-url.layerparam(param-name="url", list="url-list", placeholder="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
datalist#url-list
- option(value="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", credit="© OpenStreetMap contributors") OSM
+ option(value="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", credit="© OpenStreetMap contributors") OSM
option(value="../../data/tilefancy.png", credit="") Fancy Test Tile
- option(value="http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png", credit='Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.') Toner Lite
+ option(value="http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png", credit='Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.') Toner Lite
.form-group(title="The subdomains used to fetch tiles. This can be a comma-separated list or a string of single-letter subdomains.")
label(for="layer-subdomains") URL Subdomains
input#layer-subdomains.layerparam(param-name="subdomains", placeholder="abc")
diff --git a/examples/tiles/main.js b/examples/tiles/main.js
index cb1cb11c69..f242505340 100644
--- a/examples/tiles/main.js
+++ b/examples/tiles/main.js
@@ -36,7 +36,7 @@
* is used by itself (e.g., 'abc' is the same as 'a,b,c').
* unitsPerPixel: set the units per pixel at zoom level 0.
* url: url to use for the map files. Placeholders are allowed. Default is
- * http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png . Other useful
+ * https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png . Other useful
* urls are are: /data/tilefancy.png
* http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png
* w: width of a tiled image (at max zoom). If w and h are specified, a
@@ -122,7 +122,7 @@ $(function () {
if (query.url) {
layerParams.url = query.url;
} else {
- layerParams.url = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ layerParams.url = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
}
if (query.subdomains) {
if (query.subdomains.indexOf(',') >= 0) {
diff --git a/karma-base.js b/karma-base.js
index 15e73bf581..f0f90ad93b 100644
--- a/karma-base.js
+++ b/karma-base.js
@@ -189,7 +189,7 @@ var notes_middleware = function (config) {
*/
var osmtiles_middleware = function (config) {
return function (request, response, next) {
- var match = request.url.match(/.*http:\/\/[a-c]\.tile.openstreetmap.org\/([0-9]+\/[0-9]+\/[0-9]+.png)$/);
+ var match = request.url.match(/.*https?:\/\/[a-c]\.tile.openstreetmap.org\/([0-9]+\/[0-9]+\/[0-9]+.png)$/);
/* Serve tiles if they have been proxied */
if (match && request.method === 'GET') {
var imagePath = 'dist/data/tiles/' + match[1];
diff --git a/src/osmLayer.js b/src/osmLayer.js
index b5f2d9f22b..0cb5cbc1f8 100644
--- a/src/osmLayer.js
+++ b/src/osmLayer.js
@@ -77,7 +77,7 @@ module.exports = (function () {
},
wrapX: true,
wrapY: false,
- url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+ url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution: 'Tile data © ' +
'OpenStreetMap contributors'
});
diff --git a/tests/headed-cases/lines.js b/tests/headed-cases/lines.js
index 7546cfe40d..17063f262f 100644
--- a/tests/headed-cases/lines.js
+++ b/tests/headed-cases/lines.js
@@ -9,7 +9,8 @@ describe('lines example', function () {
});
it('basic', function (done) {
- $('#map').attr('src', '/examples/lines/index.html');
+ // use an http url for the map so we can proxy it for the test
+ $('#map').attr('src', '/examples/lines/index.html?url=http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
imageTest.imageTest('exampleLines', '#map', 0.0015, done, null, 0, 2, '#map.ready');
}, 10000);
it('more lines', function (done) {
diff --git a/tutorials/tile_source/index.pug b/tutorials/tile_source/index.pug
index 90607223da..85cf532ed7 100644
--- a/tutorials/tile_source/index.pug
+++ b/tutorials/tile_source/index.pug
@@ -24,8 +24,8 @@ block mainTutorial
layer.attribution(
'Map tiles by Stamen Design, ' +
'under CC BY 3.0. ' +
- 'Data by OpenStreetMap, ' +
- 'under ODbL.')
+ 'Data by OpenStreetMap, ' +
+ 'under ODbL.')
+codeblock_test('url is from stamen.com',
'layer.url().match(/stamen/)'
)
@@ -39,7 +39,7 @@ block mainTutorial
});
var layer = map.createLayer('osm', {
url: 'http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png',
- attribution: 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
+ attribution: 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
});
+codeblock_test('map has one osm layer from stamen', [
'map.layers().length === 1',