AnsweredAssumed Answered

Why can I not combine LocateButton and ArcGISDynamicMapServiceLayer in the same application?

Question asked by deleted-user-dbQhBq-o3nyM on Nov 4, 2014
Latest reply on Nov 4, 2014 by deleted-user-dbQhBq-o3nyM

You might be able to tell, I'm a newbie to this javascript API. I have had luck creating web applications of both the LocateButton and one of the ArcGISDynamicMapServiceLayer in separate applications, but when I try to combine the two, it comes up blank.


Can someone explain to me, a newbie, why this won't work please? Can you give me a link to a functioning web application built on Javascript and HTML with multiple widgets in it?


<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">


    <link rel="stylesheet" href=""/>

    <link href="//" rel="stylesheet" media="screen">

    <link rel="stylesheet" type="text/css" href="">


      html, body, #mapDiv{

        padding: 0;

        margin: 0;

        height: 100%;


      #LocateButton {

      position: absolute;

      top: 98px;

      left: 20px;

      z-index: 50;



    <script src=""></script>


      var map;









      ], function (

        map, LocateButton, ImageParameters, ArcGISDynamicMapServiceLayer,  ) {



        map = new Map("mapDiv", {


          zoom: 11,

          center:[-110.60, 39.60],

          sliderOrientation : "horizontal",

          scrollWheelZoom: true




        var imageParameters = new ImageParameters();

        imageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8.



        //Takes a URL to a non cached map service.

        var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("", {

          "opacity" : 1,

          "imageParameters" : imageParameters




        var geoLocate = new LocateButton({

        map: map

      }, "LocateButton");














    <div id="mapDiv"></div>


  <!-- jQuery (for Bootstrap's JavaScript plugins). NOTE: You can also use pure Dojo. See examples. -->

    <script src=""></script>

    <!-- Include all  plugins or individual files as needed -->

    <script src="//"></script>