{"action":"created","issue":{"url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/23","labels_url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/23/comments","events_url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/23/events","html_url":"https://github.com/Esri/map-journal-storytelling-template-js/issues/23","id":57366740,"number":23,"title":"Map point section links","user":{"login":"rossthedevigner","id":5264084,"avatar_url":"https://avatars.githubusercontent.com/u/5264084?v=3","gravatar_id":"","url":"https://api.github.com/users/rossthedevigner","html_url":"https://github.com/rossthedevigner","followers_url":"https://api.github.com/users/rossthedevigner/followers","following_url":"https://api.github.com/users/rossthedevigner/following{/other_user}","gists_url":"https://api.github.com/users/rossthedevigner/gists{/gist_id}","starred_url":"https://api.github.com/users/rossthedevigner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossthedevigner/subscriptions","organizations_url":"https://api.github.com/users/rossthedevigner/orgs","repos_url":"https://api.github.com/users/rossthedevigner/repos","events_url":"https://api.github.com/users/rossthedevigner/events{/privacy}","received_events_url":"https://api.github.com/users/rossthedevigner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-02-11T19:43:54Z","updated_at":"2015-06-23T23:35:33Z","closed_at":null,"body":"I've created a map with points in ArcGIS online, but I'm unable to link to different sections from that map. I see this in the Readme, but I'm not clear what this means:\r\n\r\n > ArcGIS Online Map Viewer doesn't allow to create those links from the editor but if those links are present in your layer attributes before you upload your data to ArcGIS Online, it will works.\r\n\r\nWhat does \"layer attributes\" refer to?\r\n\r\nI'm trying to duplicate the same section linking as seen here: http://storymaps.esri.com/stories/2014/bee-tour/\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/comments/114674478","html_url":"https://github.com/Esri/map-journal-storytelling-template-js/issues/23#issuecomment-114674478","issue_url":"https://api.github.com/repos/Esri/map-journal-storytelling-template-js/issues/23","id":114674478,"user":{"login":"mgrollinsdcr","id":13022723,"avatar_url":"https://avatars.githubusercontent.com/u/13022723?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrollinsdcr","html_url":"https://github.com/mgrollinsdcr","followers_url":"https://api.github.com/users/mgrollinsdcr/followers","following_url":"https://api.github.com/users/mgrollinsdcr/following{/other_user}","gists_url":"https://api.github.com/users/mgrollinsdcr/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrollinsdcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrollinsdcr/subscriptions","organizations_url":"https://api.github.com/users/mgrollinsdcr/orgs","repos_url":"https://api.github.com/users/mgrollinsdcr/repos","events_url":"https://api.github.com/users/mgrollinsdcr/events{/privacy}","received_events_url":"https://api.github.com/users/mgrollinsdcr/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T23:35:33Z","updated_at":"2015-06-23T23:35:33Z","body":"Seems like we may be close!\r\nThis is what my index.html file looks like, but still no good!\r\n\r\n--------------------------------------------------------------------------------\r\n<script type=\"text/javascript\" src=\"app/main-config.js\"></script>\r\n                                <script type=\"text/javascript\">\r\n                                                require([\"dojo/topic\"], function(topic) {\r\n                                                                /*\r\n                                                                * Custom Javascript to be executed while the application is initializing goes here\r\n                                                                */\r\n\r\n                                                                // The application is ready\r\n                                                                topic.subscribe(\"tpl-ready\", function(){\r\n                                                                                /*\r\n                                                                                * Custom Javascript to be executed when the application is ready goes here\r\n                                                                                */\r\n                                                                });\r\n\r\n                                                /*\r\n * Set up a click handler on the feature of the map to navigate the story\r\n     */\r\n\r\n    // Configure the webmap id and layer id\r\n    // To get the layer id, just configure the webmap and run the application,\r\n    //  all the layer ids of your webmap will be printed in the console\r\n    var WEBMAP_ID = \"eff825ecea244997826d0de595fbbdd2\",\r\n        LAYER_ID = \"featureServer_0\";\r\n\r\n    var clickHandlerIsSetup = false;\r\n\r\n    topic.subscribe(\"story-loaded-map\", function(result){\r\n        if ( result.id == WEBMAP_ID && ! clickHandlerIsSetup ) {\r\n            var map = app.maps[result.id].response.map,\r\n                layer = map.getLayer(LAYER_ID);\r\n\r\n            console.log('layers id', map.graphicsLayerIds);\r\n\r\n            if ( layer ) {\r\n                layer.on(\"mouse-over\", function(e){\r\n                    map.setMapCursor(\"pointer\");\r\n                    map.infoWindow.setContent(\"<b>\"+e.graphic.attributes.name.split(\",\")[0]+\"</b><br/><i>Click to zoom</i>\");\r\n                    map.infoWindow.show(e.graphic.geometry);\r\n                });\r\n\r\n                layer.on(\"mouse-out\", function(e){\r\n                    map.setMapCursor(\"default\");\r\n                    map.infoWindow.hide();\r\n                });\r\n\r\n                layer.on(\"click\", function(e){\r\n                    var index = e.graphic.attributes[\"__OBJECTID\"];\r\n                    topic.publish(\"story-navigate-section\", index);\r\n                });\r\n            }\r\n\r\n            clickHandlerIsSetup = true;\r\n        }\r\n    });\r\n});\r\n                                </script>\r\n                </body>\r\n</html>\r\n\r\nFrom: glazou [mailto:notifications@github.com]\r\nSent: Tuesday, June 23, 2015 7:00 PM\r\nTo: Esri/map-journal-storytelling-template-js\r\nCc: Rollins, Megan (DCR)\r\nSubject: Re: [map-journal-storytelling-template-js] Map point section links (#23)\r\n\r\n\r\nI think I found your issue, the documentation is not clear enough and you must have pasted the code at a wrong place, this is how it should looks like\r\n\r\n[image]<https://cloud.githubusercontent.com/assets/994078/8319176/c1b0fc3e-19c0-11e5-9b94-00bb8f655d79.png>\r\n\r\ni.e. from the sample of code the following is already present in index.html\r\n\r\nrequire([\"dojo/topic\"], function(topic) {\r\n\r\n    /*\r\n\r\n     * Custom Javascript to be executed while the application is initializing goes here\r\n\r\n     */\r\n\r\n\r\n\r\n    // The application is ready\r\n\r\n    topic.subscribe(\"tpl-ready\", function(){\r\n\r\n        /*\r\n\r\n         * Custom Javascript to be executed when the application is ready goes here\r\n\r\n         */\r\n\r\n    });\r\n\r\n—\r\nReply to this email directly or view it on GitHub<https://github.com/Esri/map-journal-storytelling-template-js/issues/23#issuecomment-114667281>.\r\n"}}