Skip to content

Commit bd2ef98

Browse files
authored
Merge branch 'master' into master
2 parents 09868ec + 51dd4e0 commit bd2ef98

File tree

11 files changed

+691
-457
lines changed

11 files changed

+691
-457
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Update the MapTiler variants [#591](https://github.com/leaflet-extras/leaflet-providers/pull/591)
6+
- Add tiles in Catalan [#562](https://github.com/leaflet-extras/leaflet-providers/pull/562)
57
- Removed Esri.DeLorme layer [#556](https://github.com/leaflet-extras/leaflet-providers/pull/556)
68
- Update GeoportailFrance tiles url & remove apikey parameter [571](https://github.com/leaflet-extras/leaflet-providers/pull/571)
79
- Add Alidade Satellite from Stadia Maps [#554](https://github.com/leaflet-extras/leaflet-providers/pull/554)

eslint.config.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import globals from 'globals';
2+
import eslintPluginEslint from '@eslint/js';
3+
import eslintPluginStylistic from '@stylistic/eslint-plugin-js';
4+
import eslintPluginHtml from 'eslint-plugin-html';
5+
6+
const config = [
7+
{
8+
files: ['**/*.js'],
9+
languageOptions: {
10+
globals: {
11+
...globals.browser,
12+
...globals.node,
13+
define: 'readonly',
14+
L: 'writable'
15+
}
16+
},
17+
plugins: {
18+
...eslintPluginStylistic.configs['all-flat'].plugins
19+
},
20+
rules: {
21+
...eslintPluginEslint.configs['recommended'].rules,
22+
...eslintPluginStylistic.configs['all-flat'].rules,
23+
'@stylistic/js/brace-style': ['error', '1tbs'],
24+
'@stylistic/js/comma-dangle': ['error', 'only-multiline'],
25+
'@stylistic/js/dot-location': ['error', 'property'],
26+
'@stylistic/js/function-call-argument-newline': ['error', 'consistent'],
27+
'@stylistic/js/indent': ['error', 'tab'],
28+
'@stylistic/js/multiline-comment-style': 'off',
29+
'@stylistic/js/no-tabs': 'off',
30+
'@stylistic/js/object-curly-spacing': ['error', 'always'],
31+
'@stylistic/js/padded-blocks': 'off',
32+
'@stylistic/js/quotes': ['error', 'single'],
33+
'@stylistic/js/quote-props': ['error', 'consistent-as-needed'],
34+
'@stylistic/js/semi': ['error', 'always'],
35+
'@stylistic/js/space-before-function-paren': ['error', 'never'],
36+
'@stylistic/js/array-element-newline': ["error", "consistent"],
37+
'no-lonely-if': 'error',
38+
'no-unused-expressions': ['error', { allowTernary: true }]
39+
}
40+
},
41+
{
42+
files: ['**/*.html'],
43+
plugins: {
44+
eslintPluginHtml,
45+
},
46+
settings: {
47+
'html/report-bad-indent': 2,
48+
},
49+
}
50+
];
51+
52+
export default config;

leaflet-providers.js

Lines changed: 86 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function (root, factory) {
1+
(function(root, factory) {
22
if (typeof define === 'function' && define.amd) {
33
// AMD. Register as an anonymous module.
44
define(['leaflet'], factory);
@@ -9,11 +9,11 @@
99
// Assume Leaflet is loaded into global object L already
1010
factory(L);
1111
}
12-
}(this, function (L) {
12+
}(this, function(L) {
1313
'use strict';
1414

1515
L.TileLayer.Provider = L.TileLayer.extend({
16-
initialize: function (arg, options) {
16+
initialize: function(arg, options) {
1717
var providers = L.TileLayer.Provider.providers;
1818

1919
var parts = arg.split('.');
@@ -52,12 +52,13 @@
5252

5353
// replace attribution placeholders with their values from toplevel provider attribution,
5454
// recursively
55-
var attributionReplacer = function (attr) {
55+
var attributionReplacer = function(attr) {
5656
if (attr.indexOf('{attribution.') === -1) {
5757
return attr;
5858
}
59-
return attr.replace(/\{attribution.(\w*)\}/g,
60-
function (match, attributionName) {
59+
return attr.replace(
60+
/\{attribution.(\w*)\}/g,
61+
function(match, attributionName) {
6162
return attributionReplacer(providers[attributionName].options.attribution);
6263
}
6364
);
@@ -120,6 +121,12 @@
120121
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://www.openstreetmap.bzh/" target="_blank">Breton OpenStreetMap Team</a>',
121122
bounds: [[46.2, -5.5], [50, 0.7]]
122123
}
124+
},
125+
CAT: {
126+
url: 'https://tile.openstreetmap.bzh/ca/{z}/{x}/{y}.png',
127+
options: {
128+
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="https://www.openstreetmap.cat" target="_blank">Breton OpenStreetMap Team</a>',
129+
}
123130
}
124131
}
125132
},
@@ -368,17 +375,17 @@
368375
Neighbourhood: 'neighbourhood'
369376
}
370377
},
371-
BaseMapDE: {
372-
url: 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/{variant}/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png',
373-
options: {
374-
attribution: 'Map data: &copy; <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>',
375-
variant: 'de_basemapde_web_raster_farbe',
376-
},
377-
variants: {
378-
Color: 'de_basemapde_web_raster_farbe',
379-
Grey: 'de_basemapde_web_raster_grau'
380-
}
381-
},
378+
BaseMapDE: {
379+
url: 'https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/{variant}/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png',
380+
options: {
381+
attribution: 'Map data: &copy; <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>',
382+
variant: 'de_basemapde_web_raster_farbe',
383+
},
384+
variants: {
385+
Color: 'de_basemapde_web_raster_farbe',
386+
Grey: 'de_basemapde_web_raster_grau'
387+
}
388+
},
382389
CyclOSM: {
383390
url: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
384391
options: {
@@ -437,9 +444,9 @@
437444
maxZoom: 21
438445
},
439446
variants: {
440-
Streets: 'streets',
441-
Basic: 'basic',
442-
Bright: 'bright',
447+
Streets: 'streets-v2',
448+
Basic: 'basic-v2',
449+
Bright: 'bright-v2',
443450
Pastel: 'pastel',
444451
Positron: 'positron',
445452
Hybrid: {
@@ -448,12 +455,35 @@
448455
ext: 'jpg'
449456
}
450457
},
451-
Toner: 'toner',
452-
Topo: 'topo',
453-
Voyager: 'voyager',
458+
Toner: 'toner-v2',
459+
Topo: 'topo-v2',
460+
Voyager: 'voyager-v2',
454461
Ocean: 'ocean',
455462
Backdrop: 'backdrop',
456-
Dataviz: 'dataviz'
463+
Dataviz: 'dataviz',
464+
DatavizLight: 'dataviz-light',
465+
DatavizDark: 'dataviz-dark',
466+
Aquarelle: {
467+
options: {
468+
variant: 'aquarelle',
469+
ext: 'webp'
470+
}
471+
},
472+
Landscape: 'landscape',
473+
Openstreetmap: {
474+
options: {
475+
variant: 'openstreetmap',
476+
ext: 'jpg'
477+
}
478+
},
479+
Outdoor: 'outdoor-v2',
480+
Satellite: {
481+
options: {
482+
variant: 'satellite',
483+
ext: 'jpg'
484+
}
485+
},
486+
Winter: 'winter-v2',
457487
}
458488
},
459489
TomTom: {
@@ -573,6 +603,7 @@
573603
}
574604
},
575605
HERE: {
606+
576607
/*
577608
* HERE maps, formerly Nokia maps.
578609
* These basemaps are free, but you need an api id and app key. Please sign up at
@@ -587,8 +618,8 @@
587618
'Map &copy; 1987-' + new Date().getFullYear() + ' <a href="http://developer.here.com">HERE</a>',
588619
subdomains: '1234',
589620
mapID: 'newest',
590-
'app_id': '<insert your app_id here>',
591-
'app_code': '<insert your app_code here>',
621+
app_id: '<insert your app_id here>',
622+
app_code: '<insert your app_code here>',
592623
base: 'base',
593624
variant: 'normal.day',
594625
maxZoom: 20,
@@ -692,6 +723,7 @@
692723
}
693724
},
694725
HEREv3: {
726+
695727
/*
696728
* HERE maps API Version 3.
697729
* These basemaps are free, but you need an API key. Please sign up at
@@ -912,12 +944,12 @@
912944
attribution: 'Kaartgegevens &copy; <a href="https://www.kadaster.nl">Kadaster</a>'
913945
},
914946
variants: {
915-
'standaard': 'standaard',
916-
'pastel': 'pastel',
917-
'grijs': 'grijs',
918-
'water': 'water',
919-
'luchtfoto': {
920-
'url': 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg',
947+
standaard: 'standaard',
948+
pastel: 'pastel',
949+
grijs: 'grijs',
950+
water: 'water',
951+
luchtfoto: {
952+
url: 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_ortho25/EPSG:3857/{z}/{x}/{y}.jpeg',
921953
}
922954
}
923955
},
@@ -1129,9 +1161,9 @@
11291161
}
11301162
},
11311163
AzureMaps: {
1132-
url:
1133-
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+
1134-
'&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}'+
1164+
url:
1165+
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' +
1166+
'&tilesetId={variant}&x={x}&y={y}&zoom={z}&language={language}' +
11351167
'&subscription-key={subscriptionKey}',
11361168
options: {
11371169
attribution: 'See https://docs.microsoft.com/en-us/rest/api/maps/render-v2/get-map-tile for details.',
@@ -1147,9 +1179,9 @@
11471179
MicrosoftBaseHybridRoad: 'microsoft.base.hybrid.road',
11481180
MicrosoftTerraMain: 'microsoft.terra.main',
11491181
MicrosoftWeatherInfraredMain: {
1150-
url:
1151-
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+
1152-
'&tilesetId={variant}&x={x}&y={y}&zoom={z}'+
1182+
url:
1183+
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' +
1184+
'&tilesetId={variant}&x={x}&y={y}&zoom={z}' +
11531185
'&timeStamp={timeStamp}&language={language}' +
11541186
'&subscription-key={subscriptionKey}',
11551187
options: {
@@ -1159,9 +1191,9 @@
11591191
},
11601192
},
11611193
MicrosoftWeatherRadarMain: {
1162-
url:
1163-
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}'+
1164-
'&tilesetId={variant}&x={x}&y={y}&zoom={z}'+
1194+
url:
1195+
'https://atlas.microsoft.com/map/tile?api-version={apiVersion}' +
1196+
'&tilesetId={variant}&x={x}&y={y}&zoom={z}' +
11651197
'&timeStamp={timeStamp}&language={language}' +
11661198
'&subscription-key={subscriptionKey}',
11671199
options: {
@@ -1191,21 +1223,21 @@
11911223
}
11921224
}
11931225
},
1194-
TopPlusOpen: {
1195-
url: 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/{variant}/default/WEBMERCATOR/{z}/{y}/{x}.png',
1196-
options: {
1197-
maxZoom: 18,
1198-
attribution: 'Map data: &copy; <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>',
1199-
variant: 'web',
1200-
},
1201-
variants: {
1202-
Color: 'web',
1203-
Grey: 'web_grau'
1204-
}
1205-
}
1226+
TopPlusOpen: {
1227+
url: 'http://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/{variant}/default/WEBMERCATOR/{z}/{y}/{x}.png',
1228+
options: {
1229+
maxZoom: 18,
1230+
attribution: 'Map data: &copy; <a href="http://www.govdata.de/dl-de/by-2-0">dl-de/by-2-0</a>',
1231+
variant: 'web',
1232+
},
1233+
variants: {
1234+
Color: 'web',
1235+
Grey: 'web_grau'
1236+
}
1237+
}
12061238
};
12071239

1208-
L.tileLayer.provider = function (provider, options) {
1240+
L.tileLayer.provider = function(provider, options) {
12091241
return new L.TileLayer.Provider(provider, options);
12101242
};
12111243

0 commit comments

Comments
 (0)