From a7620f83a6cd02ef367709dc86b3f5279c646dd0 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sat, 28 Jul 2018 16:36:01 +0100 Subject: [PATCH] Fixed broken token replacer function. --- src/config/tokens.json | 3 +-- src/libs/style.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config/tokens.json b/src/config/tokens.json index 5a5adf57..d08e6383 100644 --- a/src/config/tokens.json +++ b/src/config/tokens.json @@ -1,6 +1,5 @@ { "mapbox": "pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6ImNpeHJmNXNmZTAwNHIycXBid2NqdTJibjMifQ.Dv1-GDpTWi0NP6xW9Fct1w", "openmaptiles": "Og58UhhtiiTaLVlPtPgs", - "thunderforest_transport": "b71f7f0ba4064f5eb9e903859a9cf5c6", - "thunderforest_outdoors": "b71f7f0ba4064f5eb9e903859a9cf5c6" + "thunderforest": "b71f7f0ba4064f5eb9e903859a9cf5c6" } diff --git a/src/libs/style.js b/src/libs/style.js index e3f75d7e..b867148d 100644 --- a/src/libs/style.js +++ b/src/libs/style.js @@ -99,7 +99,7 @@ function replaceSourceAccessToken(mapStyle, key, opts={}) { function replaceAccessTokens(mapStyle, opts={}) { let changedStyle = mapStyle; - Object.keys(tokens).forEach((tokenKey) => { + Object.keys(mapStyle.sources).forEach((tokenKey) => { changedStyle = replaceSourceAccessToken(changedStyle, tokenKey, opts); })