<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access Layer on click event in Classic Esri Story Maps Questions</title>
    <link>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751117#M8498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can access the maps included in your Journal through the app.maps object, for example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;app.maps['27e642041b9a498e9d9253b20a5a7d44'].response.map&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will give you access to the map object of web map with the specific id &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use any method of the ArcGIS API for JavaScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that app.maps is only populated when you navigate to the the section containing it.&lt;/P&gt;&lt;P&gt;So you have to listen to a map load before placing your click listener&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// After a map is loaded (when the map starts to render)&amp;nbsp; 
topic.subscribe("story-loaded-map", function(result){
&amp;nbsp;&amp;nbsp; console.log("The map", result.id, "has been loaded");
&amp;nbsp;&amp;nbsp; app.maps[result.id].response.map...
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code can be placed in index.html after this line &lt;A href="https://github.com/Esri/map-journal-storytelling-template-js/blob/master/src/index.html#L347" title="https://github.com/Esri/map-journal-storytelling-template-js/blob/master/src/index.html#L347" rel="nofollow noopener noreferrer" target="_blank"&gt;map-journal-storytelling-template-js/index.html at master · Esri/map-journal-storytelling-template-js · GitHub&lt;/A&gt; &lt;/P&gt;&lt;P&gt;More information about customization at &lt;A href="https://github.com/Esri/map-journal-storytelling-template-js#developer-guide" title="https://github.com/Esri/map-journal-storytelling-template-js#developer-guide" rel="nofollow noopener noreferrer" target="_blank"&gt;GitHub - Esri/map-journal-storytelling-template-js: The Story Map Journal is ideal when you want to combine narrative te…&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:53:56 GMT</pubDate>
    <dc:creator>GregoryL_Azou</dc:creator>
    <dc:date>2021-12-12T07:53:56Z</dc:date>
    <item>
      <title>Access Layer on click event</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751116#M8497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way to access the on click event of the layer that I use in my journal map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 12:21:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751116#M8497</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2016-04-22T12:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Access Layer on click event</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751117#M8498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can access the maps included in your Journal through the app.maps object, for example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;app.maps['27e642041b9a498e9d9253b20a5a7d44'].response.map&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will give you access to the map object of web map with the specific id &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use any method of the ArcGIS API for JavaScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that app.maps is only populated when you navigate to the the section containing it.&lt;/P&gt;&lt;P&gt;So you have to listen to a map load before placing your click listener&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// After a map is loaded (when the map starts to render)&amp;nbsp; 
topic.subscribe("story-loaded-map", function(result){
&amp;nbsp;&amp;nbsp; console.log("The map", result.id, "has been loaded");
&amp;nbsp;&amp;nbsp; app.maps[result.id].response.map...
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code can be placed in index.html after this line &lt;A href="https://github.com/Esri/map-journal-storytelling-template-js/blob/master/src/index.html#L347" title="https://github.com/Esri/map-journal-storytelling-template-js/blob/master/src/index.html#L347" rel="nofollow noopener noreferrer" target="_blank"&gt;map-journal-storytelling-template-js/index.html at master · Esri/map-journal-storytelling-template-js · GitHub&lt;/A&gt; &lt;/P&gt;&lt;P&gt;More information about customization at &lt;A href="https://github.com/Esri/map-journal-storytelling-template-js#developer-guide" title="https://github.com/Esri/map-journal-storytelling-template-js#developer-guide" rel="nofollow noopener noreferrer" target="_blank"&gt;GitHub - Esri/map-journal-storytelling-template-js: The Story Map Journal is ideal when you want to combine narrative te…&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751117#M8498</guid>
      <dc:creator>GregoryL_Azou</dc:creator>
      <dc:date>2021-12-12T07:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Access Layer on click event</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751118#M8499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/access-layer-on-click-event/m-p/751118#M8499</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2016-04-22T15:45:44Z</dc:date>
    </item>
  </channel>
</rss>

