Created
October 25, 2017 14:10
-
-
Save apfister/8c79396eb82c486273b3827743d4a22a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["dojo/topic"], function(topic) { | |
/* | |
* Custom Javascript to be executed while the application is initializing goes here | |
*/ | |
// The application is ready | |
topic.subscribe("tpl-ready", function() { | |
/* | |
* Custom Javascript to be executed when the application is ready goes here | |
*/ | |
}); | |
var WEBMAP_ID = "fc3f658415c4400cb850ec8152c39561", | |
LAYER_ID = "TrailSegments_5706"; | |
var clickHandlerIsSetup = false; | |
topic.subscribe("story-loaded-map", function (result) { | |
if (result.id == WEBMAP_ID && !clickHandlerIsSetup) { | |
var map = app.maps[result.id].response.map, | |
layer = map.getLayer(LAYER_ID); | |
if (layer) { | |
layer.on("click", function(e) { | |
var index = e.graphic.attributes["Index_"]; | |
topic.publish("story-navigate-section", index); | |
}); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment