AnsweredAssumed Answered

Legend and scale bar

Question asked by knozaki on Oct 3, 2013
Latest reply on Oct 4, 2013 by cschneebeck
I would like to add legend and scale bar to the following code.
I am little confused because many examples use web maps, not dynamic map services.
Thank you very much for your help.


<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Create Map and add a dynamic layer</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"/>
    <style>
      html,body,#mapDiv{
        padding:0;
        margin:0;
        height:100%;
      }

    </style>
    <script src="http://js.arcgis.com/3.7/"></script>
    <script>
      dojo.require("esri.map");

      var map;

      function init() {
        map = new esri.Map("mapDiv", {
          sliderOrientation: "vertical"
        });

        var imageParameters = new esri.layers.ImageParameters();
        imageParameters.format = "jpeg";  //set the image type to PNG24, note default is PNG8.

        //Takes a URL to a non cached map service.
        var mcdonough = new esri.layers.ArcGISDynamicMapServiceLayer("", {
          "opacity":1,
        });

         //Takes a URL to a non cached map service.
        var aerials = new esri.layers.ArcGISDynamicMapServiceLayer("", {
          "opacity":1,
          "minScale":24000,
        });
              
        map.addLayer(aerials);
        map.addLayer(mcdonough);
      }

      dojo.ready(init);
    </script>
  </head>
  <body>
    <div id="mapDiv"></div>

  </body>
</html>

Outcomes