<?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: How to add address search bar to a map template? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283782#M26191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@Natalie, you are on the right track. The Address Matching sample that you referenced is what needs to be coded into your existing application. If you wish to give it a try I have several suggestions. You're really close and it's not too many steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Copy the following HTML tags into your template's index.html file and place this beneath the &amp;lt;div id="description"&amp;gt;&amp;lt;/div&amp;gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;div&amp;gt;&amp;lt;textarea type="text" id="address"/&amp;gt;380 New York St, Redlands&amp;lt;/textArea&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;button dojotype="dijit.form.Button" onclick="locate()"&amp;gt; Locate&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) In layout.js do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste this at the top of the page:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.require("esri.tasks.locator"); dojo.require("dijit.form.Button");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste these two lines of code right inside the function initMap(): &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;locator = new esri.tasks.Locator("http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer"); dojo.connect(locator, "onAddressToLocationsComplete", showResults); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste all the sample code from function locate(){...} and function showResults(candidates){...} and place it right below function addScalebar() in layout.js. So locate() and showResults() will become new functions in the layout.js file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If all goes well, that should do it. Test the app in a web browser. Note that you have to host these files that you downloaded from ArcGIS.com on your own web server. I hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri Developer Network Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2012 23:48:36 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2012-01-26T23:48:36Z</dc:date>
    <item>
      <title>How to add address search bar to a map template?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283781#M26190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am an inexperienced programmer.&amp;nbsp; I have added my map and data to the chrome-identify template for Javascript (following the template process &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm" rel="nofollow" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; in the "Getting Started" section).&amp;nbsp; All is working well. The problem is that I need an address search bar on this template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the most simple way to add an address search bar/address location tool to my template?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only the "basic viewer" template includes an address search bar.&amp;nbsp; I don't want to use this template because I want the identify sidebar that is already set up in the other template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Frankly, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm" rel="nofollow" target="_blank"&gt;this sample code&lt;/A&gt;&lt;SPAN&gt; (go to Address Matching - Find an Address on the left sidebar)&amp;nbsp; looks too hard for me to try to add to my template.&amp;nbsp; Please let me know if there are any easier options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 22:58:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283781#M26190</guid>
      <dc:creator>N_Young</dc:creator>
      <dc:date>2012-01-10T22:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add address search bar to a map template?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283782#M26191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@Natalie, you are on the right track. The Address Matching sample that you referenced is what needs to be coded into your existing application. If you wish to give it a try I have several suggestions. You're really close and it's not too many steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Copy the following HTML tags into your template's index.html file and place this beneath the &amp;lt;div id="description"&amp;gt;&amp;lt;/div&amp;gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;div&amp;gt;&amp;lt;textarea type="text" id="address"/&amp;gt;380 New York St, Redlands&amp;lt;/textArea&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;button dojotype="dijit.form.Button" onclick="locate()"&amp;gt; Locate&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) In layout.js do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste this at the top of the page:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.require("esri.tasks.locator"); dojo.require("dijit.form.Button");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste these two lines of code right inside the function initMap(): &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;locator = new esri.tasks.Locator("http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer"); dojo.connect(locator, "onAddressToLocationsComplete", showResults); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- copy and paste all the sample code from function locate(){...} and function showResults(candidates){...} and place it right below function addScalebar() in layout.js. So locate() and showResults() will become new functions in the layout.js file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If all goes well, that should do it. Test the app in a web browser. Note that you have to host these files that you downloaded from ArcGIS.com on your own web server. I hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri Developer Network Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 23:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283782#M26191</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2012-01-26T23:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add address search bar to a map template?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283783#M26192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!&amp;nbsp; I actually did get it figured out but this post will be very helpful to others who want to do this.&amp;nbsp; Thanks for clearly explaining which parts of the sample code go in which files of the template!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 16:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-address-search-bar-to-a-map-template/m-p/283783#M26192</guid>
      <dc:creator>N_Young</dc:creator>
      <dc:date>2012-01-27T16:52:34Z</dc:date>
    </item>
  </channel>
</rss>

