Hey everybody,
is there a way to access the on click event of the layer that I use in my journal map?
Thanks,
Tim
Solved! Go to Solution.
Yes, you can access the maps included in your Journal through the app.maps object, for example
app.maps['27e642041b9a498e9d9253b20a5a7d44'].response.map
will give you access to the map object of web map with the specific id
Then you can use any method of the ArcGIS API for JavaScript.
Note that app.maps is only populated when you navigate to the the section containing it.
So you have to listen to a map load before placing your click listener
// After a map is loaded (when the map starts to render) topic.subscribe("story-loaded-map", function(result){ console.log("The map", result.id, "has been loaded"); app.maps[result.id].response.map... });
This code can be placed in index.html after this line map-journal-storytelling-template-js/index.html at master · Esri/map-journal-storytelling-template-j...
More information about customization at GitHub - Esri/map-journal-storytelling-template-js: The Story Map Journal is ideal when you want to ...
Yes, you can access the maps included in your Journal through the app.maps object, for example
app.maps['27e642041b9a498e9d9253b20a5a7d44'].response.map
will give you access to the map object of web map with the specific id
Then you can use any method of the ArcGIS API for JavaScript.
Note that app.maps is only populated when you navigate to the the section containing it.
So you have to listen to a map load before placing your click listener
// After a map is loaded (when the map starts to render) topic.subscribe("story-loaded-map", function(result){ console.log("The map", result.id, "has been loaded"); app.maps[result.id].response.map... });
This code can be placed in index.html after this line map-journal-storytelling-template-js/index.html at master · Esri/map-journal-storytelling-template-j...
More information about customization at GitHub - Esri/map-journal-storytelling-template-js: The Story Map Journal is ideal when you want to ...
Thanks!