From 826e08149b3373f3048e4c55a432a489afc97bf7 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 8 Nov 2018 13:53:13 -0500 Subject: [PATCH] Setup data layers before starting the walkthrough (closes #5136) --- modules/ui/intro/intro.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/ui/intro/intro.js b/modules/ui/intro/intro.js index 3dcf67537..39ed10db2 100644 --- a/modules/ui/intro/intro.js +++ b/modules/ui/intro/intro.js @@ -84,16 +84,23 @@ export function uiIntro(context) { context.history().merge(_values(coreGraph().load(introGraph).entities)); context.history().checkpoint('initial'); + // Setup imagery var imagery = context.background().findSource(INTRO_IMAGERY); if (imagery) { context.background().baseLayerSource(imagery); } else { context.background().bing(); } - overlays.forEach(function (d) { + overlays.forEach(function(d) { context.background().toggleOverlayLayer(d); }); + // Setup data layers (only OSM) + var layers = context.layers(); + layers.all().forEach(function(item) { + item.layer.enabled(item.id === 'osm'); + }); + // Mock geocoder services.geocoder.countryCode = function(location, callback) { callback(null, t('intro.graph.countrycode')); @@ -150,7 +157,7 @@ export function uiIntro(context) { if (osm) { osm.toggle(true).reset().caches(caches); } context.history().reset().merge(_values(baseEntities)); context.background().baseLayerSource(background); - overlays.forEach(function (d) { context.background().toggleOverlayLayer(d); }); + overlays.forEach(function(d) { context.background().toggleOverlayLayer(d); }); if (history) { context.history().fromJSON(history, false); } context.map().centerZoom(center, zoom); window.location.replace(hash);