Skip to content

Commit

Permalink
Add Jawg Maps provider (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit authored May 17, 2020
1 parent 268a27a commit 2e8703d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
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

0 comments on commit 2e8703d

Please sign in to comment.