Added ability to specify custom overlays in configuration
Analogous to adding base layers, custom overlays can be added in
the `config.js` file:
```javascript
BR.conf.overlays = {
'Hill shading': 'http://{s}.tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png'
};
```
This commit is contained in:
parent
42d04e52c2
commit
ffff29dfcc
3 changed files with 61 additions and 55 deletions
92
dist/brouter-web.js
vendored
92
dist/brouter-web.js
vendored
File diff suppressed because one or more lines are too long
2
dist/brouter-web.js.map
vendored
2
dist/brouter-web.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -104,6 +104,12 @@
|
|||
baseLayers[i] = L.tileLayer(BR.conf.baseLayers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i in BR.conf.overlays) {
|
||||
if (BR.conf.overlays.hasOwnProperty(i)) {
|
||||
overlays[i] = L.tileLayer(BR.conf.overlays[i]);
|
||||
}
|
||||
}
|
||||
// after applying custom base layer configurations, add first base layer to map
|
||||
var firstLayer = baseLayers[Object.keys(baseLayers)[0]];
|
||||
if (firstLayer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue