2.) Create a div element to hold the map:
4.) Initialize the map object from the dojo.addOnLoad method:
Obviously you will also want to add some layers to your map and this can be accomplished through either the ArcGISTiledMapServiceLayer or ArcGISDynamicMapServiceLayer. Below you will see how to code examples for both types of layer.
The result of these few simple lines of code can be viewed here. I would like to point out two additional things that you may have noticed. First, we did not specify any code to add map navigation controls or functionality. This is because the navigation tools are built into the API including a zoom control slider and the ability to use your mouse and keyboard for panning and zooming. I should also point out that it is not necessary to have ArcGIS Server loaded on your server. You simply need access to an existing map service somewhere on the web. In this case, we are accessing web mapping services provided by one of ESRI's sample ArcGIS Servers.
ArcGIS Server Resource Center
Sample Server 1
Sample Server 2
This article was written by Eric Pimpler at GeoSpatial Training Services. Geospatial Training Services provide a
range of geoweb courses.