Hi,
My intent was to create a map journal with links from a main map to the sections of the journal, I'm pretty new to storymaps and javascript so I'm sure I made some mistakes. I followed Cooper Thomas's tutorial - https://developerscorner.storymaps.arcgis.com/navigate-map-journal-sections-using-the-mainstage-map-ab827a105d0c . I have used a map with a singe feature layer to navigate to a few sections in the sidebar in the map journal. When run on local test server it doesn't navigate to the section. Here is the custom-scripts.js file- (copied from the tutorial)
| 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 = "11a773702bd14ab2a2a78ea25ad00536", |
| LAYER_ID = "csv_755"; |
| |
| 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["StoryIndex"]; |
| topic.publish("story-navigate-section", index); |
| }); |
| } |
| } |
| }); |
| }); |
the appid is - dffdedb3027143c5b9394bb7881d201
Is there a problem with the layer? I uploaded a csv file to create the layer in the online mapviewer.
Thank you
Craig Smith