Fixed broken token replacer function.

This commit is contained in:
orangemug 2018-07-28 16:36:01 +01:00
parent 0384181ee1
commit a7620f83a6
2 changed files with 2 additions and 3 deletions

View file

@ -1,6 +1,5 @@
{ {
"mapbox": "pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6ImNpeHJmNXNmZTAwNHIycXBid2NqdTJibjMifQ.Dv1-GDpTWi0NP6xW9Fct1w", "mapbox": "pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6ImNpeHJmNXNmZTAwNHIycXBid2NqdTJibjMifQ.Dv1-GDpTWi0NP6xW9Fct1w",
"openmaptiles": "Og58UhhtiiTaLVlPtPgs", "openmaptiles": "Og58UhhtiiTaLVlPtPgs",
"thunderforest_transport": "b71f7f0ba4064f5eb9e903859a9cf5c6", "thunderforest": "b71f7f0ba4064f5eb9e903859a9cf5c6"
"thunderforest_outdoors": "b71f7f0ba4064f5eb9e903859a9cf5c6"
} }

View file

@ -99,7 +99,7 @@ function replaceSourceAccessToken(mapStyle, key, opts={}) {
function replaceAccessTokens(mapStyle, opts={}) { function replaceAccessTokens(mapStyle, opts={}) {
let changedStyle = mapStyle; let changedStyle = mapStyle;
Object.keys(tokens).forEach((tokenKey) => { Object.keys(mapStyle.sources).forEach((tokenKey) => {
changedStyle = replaceSourceAccessToken(changedStyle, tokenKey, opts); changedStyle = replaceSourceAccessToken(changedStyle, tokenKey, opts);
}) })