<?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: execute a function in another file in Classic Esri Story Maps Questions</title>
    <link>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496327#M5744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great, glad to hear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All options in index.html are disabled in development mode when you are using a webmap id.&lt;/P&gt;&lt;P&gt;If you were using an app id, that configuration would be respected. It is best practice to use an app id, for that just build a tour in ArcGIS Online by sharing your webmap, set the layout setting to integrated and use that app id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The options in index.html will be active when you 'build' the application to optimize it for deployment, see &lt;A href="https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code" title="https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code"&gt;https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code&lt;/A&gt; &lt;/P&gt;&lt;P&gt;No matter if you use webmap or app id, make sure to do that so you get the best performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jul 2015 15:33:24 GMT</pubDate>
    <dc:creator>GregoryL_Azou</dc:creator>
    <dc:date>2015-07-29T15:33:24Z</dc:date>
    <item>
      <title>execute a function in another file</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496324#M5741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I am trying to add buttons that will change the tour point layer in the storytelling templates. To do so I am trying to add a button that will send a parameter and activate a function in another js file. (I am not sure for a 100% that this is the right way, but I do think that this may be the way).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I am trying that this button:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;lt;button onclick="myFunction()"&amp;gt;button check&amp;lt;/button&amp;gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;lt;script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;function myFunction() {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; require(["storymaps/maptour/core/MainView"],function(MainView){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MainView.webmapLoaded();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;will go to the mainView js file and activate the webmapLoded function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;The webmapLoaded function is written like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;this.webmapLoaded = function()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;{function code};&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;And it is sitting inside a:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;return function MainView()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 7pt; font-family: Consolas;"&gt;{function code}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I know this may be a basic knowledge that I am missing, I am trying to teach myself programing and JavaScript.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;And I thank you very much for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 09:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496324#M5741</guid>
      <dc:creator>roialgavish</dc:creator>
      <dc:date>2015-07-28T09:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: execute a function in another file</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496325#M5742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are in the good direction but you can't use MainView like this.&lt;/P&gt;&lt;P&gt;Instead in index.html, replace the following lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;else
&amp;nbsp; Core.init(new MainView());&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;else {
&amp;nbsp; window.mainView = new MainView();
&amp;nbsp; Core.init(window.mainView);
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This store a reference to mainView in an object that you can manipulate later in your function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function myFunction() {
&amp;nbsp; window.mainView.webmapLoaded();
};&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will reload the data. Then I guess you have to pass your parameter to specify the layer to be used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:49:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496325#M5742</guid>
      <dc:creator>GregoryL_Azou</dc:creator>
      <dc:date>2021-12-11T21:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: execute a function in another file</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496326#M5743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory,&lt;/P&gt;&lt;P&gt;Again thanks allot, it worked grate.&lt;/P&gt;&lt;P&gt;One more thing is there a way to change the layout in the developer mode to be &lt;SPAN style="font-size: 10.0pt; font-family: Consolas;"&gt;integrated&lt;/SPAN&gt;? The developer mode ignores this config option. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 10:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496326#M5743</guid>
      <dc:creator>roialgavish</dc:creator>
      <dc:date>2015-07-29T10:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: execute a function in another file</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496327#M5744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great, glad to hear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All options in index.html are disabled in development mode when you are using a webmap id.&lt;/P&gt;&lt;P&gt;If you were using an app id, that configuration would be respected. It is best practice to use an app id, for that just build a tour in ArcGIS Online by sharing your webmap, set the layout setting to integrated and use that app id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The options in index.html will be active when you 'build' the application to optimize it for deployment, see &lt;A href="https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code" title="https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code"&gt;https://github.com/Esri/map-tour-storytelling-template-js#how-to-build-application-from-the-source-code&lt;/A&gt; &lt;/P&gt;&lt;P&gt;No matter if you use webmap or app id, make sure to do that so you get the best performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 15:33:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/execute-a-function-in-another-file/m-p/496327#M5744</guid>
      <dc:creator>GregoryL_Azou</dc:creator>
      <dc:date>2015-07-29T15:33:24Z</dc:date>
    </item>
  </channel>
</rss>

