Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jawg Maps provider #348

Merged
merged 2 commits into from
May 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ L.tileLayer.provider('HERE.terrainDay', {
}).addTo(map);
```

### Jawg Maps

In order to use Jawg Maps, you must [register](https://www.jawg.io/lab). Once registered, your access token will be located [here](https://www.jawg.io/lab/access-tokens) and you will access to all Jawg default maps (variants) and your own customized maps :

```JavaScript
L.tileLayer.provider('Jawg.Streets', {
variant: '<insert map id here or blank for default variant>',
accessToken: '<insert access token here>'
}).addTo(map);
```

### Mapbox

In order to use Mapbox maps, you must [register](https://tiles.mapbox.com/signup). You can get map_ID (i.e mapbox.satellite) and ACCESS_TOKEN from [Mapbox projects](https://www.mapbox.com/projects):
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),
'Jawg Streets': L.tileLayer.provider('Jawg.Streets'),
'Jawg Terrain': L.tileLayer.provider('Jawg.Terrain'),
'Esri WorldStreetMap': L.tileLayer.provider('Esri.WorldStreetMap'),
'Esri DeLorme': L.tileLayer.provider('Esri.DeLorme'),
'Esri WorldTopoMap': L.tileLayer.provider('Esri.WorldTopoMap'),
Expand Down
23 changes: 23 additions & 0 deletions leaflet-providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,29 @@
RoadsAndLabels: 'roads_and_labels'
}
},
Jawg: {
url: 'https://{s}.tile.jawg.io/{variant}/{z}/{x}/{y}{r}.png?access-token={accessToken}',
options: {
attribution:
'<a href="http://jawg.io" title="Tiles Courtesy of Jawg Maps" target="_blank">&copy; <b>Jawg</b>Maps</a> ' +
'{attribution.OpenStreetMap}',
minZoom: 0,
maxZoom: 22,
subdomains: 'abcd',
variant: 'jawg-terrain',
// Get your own Jawg access token here : https://www.jawg.io/lab/
// NB : this is a demonstration key that comes with no guarantee
accessToken: 'PyTJUlEU1OPJwCJlW1k0NC8JIt2CALpyuj7uc066O7XbdZCjWEL3WYJIk6dnXtps',
},
variants: {
Streets: 'jawg-streets',
Terrain: 'jawg-terrain',
Sunny: 'jawg-sunny',
Dark: 'jawg-dark',
Light: 'jawg-light',
Matrix: 'jawg-matrix'
}
},
MapBox: {
url: 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}{r}?access_token={accessToken}',
options: {
Expand Down