Skip to content
Kelly Hutchins edited this page Dec 10, 2013 · 12 revisions
  1. Download and setup the template on your local web server.
  2. Open the index.html file in your favorite text editor.
  3. Search index.html for the div with the id of map and add a new line after the div.
  4. Create a new div with an id of locateDiv and save the changes to index.html. Screenshot of new div
  5. Open the **javascript/layout.js ** file in your favorite text editor.
  6. Load the Locate button module by adding the following require after the existing require statements at the top of the layout.js file.
 dojo.require("esri.dijit.LocateButton")
  1. Search layout.js for the initUI function and add the following code to this function. This code creates a new Locate button widget and associates it with the map.
    var locateButton = new esri.dijit.LocateButton({
     map: map
    },"locateDiv");
    locateButton.startup();
  1. Save the layout.js file.
  2. Open the css/layout.css file in your favorite text editor.
  3. Add a new style to the file that is used to position the new Locate button on the map. This css will position the button below the existing zoom slider on the map.
    #locateDiv{
      position:absolute;
      top:120px;
      left:20px;
      z-index:30;
    }
Clone this wiki locally