Select to view content in your preferred language

centering in simple tiled map

609
1
05-16-2013 06:56 AM
GyeyoungChoi
Deactivated User
Hello,
I made a very simple map but it won't change the initial map center.

can anyone give me some advice?

Thank you,

Jack
    <script>
      dojo.require("esri.map");

      var map;

      function init() {
        map = new esri.Map("mapDiv", { 
   center:[-96,30],
        });

        var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/FCOR/BaseMapTileTest/MapServer", {
        });
        
        map.addLayer(dynamicMapServiceLayer);
      }

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

  </body>
</html>
0 Kudos
1 Reply
JohnGravois
Deactivated User
what is the coordinate system of your dynamicMapService?  the lat/long values you are currently using would only help you center the map if your own service was published in WGS84 or Web Mercator.

try adding a basemap property (which ensures a web mercator tiledMapService is loaded first) in the map constructor to see what i mean.

map = new esri.Map("mapDiv", { 
                        basemap: "gray",
   center:[-96,30],
        });
0 Kudos