Skip to content

Commit

Permalink
Setup data layers before starting the walkthrough
Browse files Browse the repository at this point in the history
(closes #5136)
  • Loading branch information
bhousel committed Nov 8, 2018
1 parent 4632625 commit 826e081
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/ui/intro/intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 826e081

Please sign in to comment.