Use preferred tile.openstreetmap.org URL

Use the preferred URL for tile.openstreetmap.org, the old aliases are no longer recommended now that tile supports HTTP/2 + HTTP/3.

Signed-off-by: Grant Slater <git@firefishy.com>
This commit is contained in:
Grant Slater
2022-08-28 00:34:35 +01:00
parent a98ef7937a
commit 775091c012
2 changed files with 3 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ new Map({
layers: [
new TileLayer({
source: new XYZ({
url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
})
})
],

View File

@@ -37,7 +37,7 @@ export const ATTRIBUTION =
* ```
* @property {number} [transition=250] Duration of the opacity transition for rendering.
* To disable the opacity transition, pass `transition: 0`.
* @property {string} [url='https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'] URL template.
* @property {string} [url='https://tile.openstreetmap.org/{z}/{x}/{y}.png'] URL template.
* Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
* @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0]
@@ -70,7 +70,7 @@ class OSM extends XYZ {
const url =
options.url !== undefined
? options.url
: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
super({
attributions: attributions,