From 8ff996b2a59d12a383c522d991bc6decff6a29c4 Mon Sep 17 00:00:00 2001
From: MapTilesAPI <65077872+MapTilesAPI@users.noreply.github.com>
Date: Mon, 25 Apr 2022 15:30:14 +0200
Subject: [PATCH 1/4] Update leaflet-providers.js
Adding MapTiles API examples, a provider for global maps in one language (English, French or Spanish).
---
leaflet-providers.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/leaflet-providers.js b/leaflet-providers.js
index 7c53afe8..a7ef1382 100644
--- a/leaflet-providers.js
+++ b/leaflet-providers.js
@@ -123,6 +123,35 @@
}
}
},
+ MapTilesAPI: {
+ url: 'https://maptiles.p.rapidapi.com/{variant}/{z}/{x}/{y}.png?rapidapi-key={apikey}',
+ options: {
+ attribution:
+ '© MapTiles API, {attribution.OpenStreetMap}',
+ variant: 'en/map/v1',
+ // Get your own MapTiles API access token here : https://www.maptilesapi.com/
+ // NB : this is a demonstration key that comes with no guarantee and not to be used in production
+ apikey: '',
+ maxZoom: 19
+ },
+ variants: {
+ OSMEnglish: {
+ options: {
+ variant: 'en/map/v1'
+ }
+ },
+ OSMFrancais: {
+ options: {
+ variant: 'fr/map/v1'
+ }
+ },
+ OSMEspagnol: {
+ options: {
+ variant: 'es/map/v1'
+ }
+ }
+ }
+ },
OpenSeaMap: {
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
options: {
From c14e49497d87f651b8cec2c1255cdc974f66d660 Mon Sep 17 00:00:00 2001
From: MapTilesAPI <65077872+MapTilesAPI@users.noreply.github.com>
Date: Mon, 25 Apr 2022 15:33:49 +0200
Subject: [PATCH 2/4] Update shared.js
Added example api key for MapTiles API. This key is not to be used in production by third parties but just for leaflet-providers.
---
preview/shared.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/preview/shared.js b/preview/shared.js
index e370e60c..8b4c5d88 100644
--- a/preview/shared.js
+++ b/preview/shared.js
@@ -9,6 +9,9 @@ var exampleAPIcodes = {
'Jawg': {
'accessToken': 'PyTJUlEU1OPJwCJlW1k0NC8JIt2CALpyuj7uc066O7XbdZCjWEL3WYJIk6dnXtps'
},
+ 'MapTilesAPI': {
+ 'apikey': '91eb180eb9msh46beac27e6084cep17a106jsn18a17417dbb6'
+ },
'Thunderforest': {
'apikey': 'db5ae1f5778a448ca662554581f283c5'
}
From 52dff1e2701f296962c4e7bb756425a3bb5b17f0 Mon Sep 17 00:00:00 2001
From: MapTilesAPI <65077872+MapTilesAPI@users.noreply.github.com>
Date: Tue, 26 Apr 2022 10:26:07 +0200
Subject: [PATCH 3/4] Update index.html
Added three OpenStreetMap Language versions provided by MapTilesAPI.
---
index.html | 3 +++
1 file changed, 3 insertions(+)
diff --git a/index.html b/index.html
index 6b6d853a..ffb1705b 100644
--- a/index.html
+++ b/index.html
@@ -41,6 +41,9 @@
'OpenStreetMap Default': defaultLayer,
'OpenStreetMap German Style': L.tileLayer.provider('OpenStreetMap.DE'),
'OpenStreetMap H.O.T.': L.tileLayer.provider('OpenStreetMap.HOT'),
+ 'MapTilesAPI OpenStreetMap in English': L.tileLayer.provider('MapTilesAPI.OSMEnglish'),
+ 'MapTilesAPI OpenStreetMap en Français': L.tileLayer.provider('MapTilesAPI.OSMFrancais'),
+ 'MapTilesAPI OpenStreetMap en Español': L.tileLayer.provider('MapTilesAPI.OSMEspagnol'),
'Thunderforest OpenCycleMap': L.tileLayer.provider('Thunderforest.OpenCycleMap'),
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
From 1d8fa874a589268ab74af883fd48dad17e6bd4f2 Mon Sep 17 00:00:00 2001
From: MapTilesAPI <65077872+MapTilesAPI@users.noreply.github.com>
Date: Tue, 26 Apr 2022 10:30:19 +0200
Subject: [PATCH 4/4] Update README.md
Added example for MapTiles API, which requires an apikey.
---
README.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/README.md b/README.md
index 8d2be861..ae7c2ba5 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,15 @@ L.tileLayer.provider('MapTiler.Streets', {
}).addTo(map);
```
+### MapTiles API
+
+In order to use OpenStreetMap in English, French or Spanish provided by MapTiles API, you must [register](https://www.maptilesapi.com/). Once registered, you have to add your key to `L.tileLayer.provider` in the options:
+```JavaScript
+L.tileLayer.provider('MapTilesAPI.OSMEnglish', {
+ apikey: ''
+}).addTo(map);
+```
+
### Thunderforest
In order to use Thunderforest maps, you must [register](https://thunderforest.com/pricing/). Once registered, you have an `api_key` which you have to pass to `L.tileLayer.provider` in the options: