AnsweredAssumed Answered

Locate Button with ArcOnline Web Map

Question asked by ELBAO on Jun 25, 2014
Latest reply on Jun 26, 2014 by ELBAO
I apologize in advance, my question is rather elementary.  I have little to no Javascript experience but you have to start somewhere, am I right?  On to my question:

I can't seem to get the Locator Button to work when I replace the standard basemap in the sample code with a arcOnline web map.  The web map works, the locator button is visible and toggles between default button and the useTracking button, but the extent of the map doesn't change and the locator symbol is not visible.

My code is here:
<!DOCTYPE HTML> <html> <head>   <meta charset="utf-8">   <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">   <title>Locate Button and WebID</title>   <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">   <style>     html, body, #mapDiv {       padding:0;       margin:0;       height:100%;     }     #LocateButton {       position: absolute;       top: 95px;       left: 20px;       z-index: 50;     }   </style>   <script src="//js.arcgis.com/3.9/"></script>   <script>      var map  var geoLocate     require([       "esri/map",       "esri/arcgis/utils",    "esri/dijit/LocateButton",       "dojo/domReady!"       ], function (Map, arcgisUtils, LocateButton) {         arcgisUtils.createMap("4778fee6371d4e83a22786029f30c7e1", "mapDiv").then(function (response) {         map = response.map        });    geoLocate = new LocateButton({         map: mapDiv,   scale: 11,   useTracking: true       }, "LocateButton");       geoLocate.startup();             });   </script>    </head>    <body>     <div id="mapDiv" class="map">  <div id="LocateButton"></div>  </div>   </body>   </html>


Thanks in advance for all of your help!

Outcomes