Setup data layers before starting the walkthrough

(closes #5136)
This commit is contained in:
Bryan Housel
2018-11-08 13:53:13 -05:00
parent 46326252bc
commit 826e08149b
+9 -2
View File
@@ -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);