I'm certain this question must have been asked/answered, but I just can't find it.

I'm running ArcGIS Server and want to build a basic viewer that points to my locally hosted services. I'm not interested in doing anything with ArcGIS.com; however all the examples hosted at esri illustrate interfacing with ArcGIS.com.

How can I point to my local map?

Alternatively, can you point me to where I can find the answer (as I'm certain this must have been asked already)

  • I explored all the resources that I was directed too, but none were totally sufficient. I eventually figured it out, but IMHO I think there should be a comprehensive guide to utilizing the api with Arc Server and NOT exclusively publish examples that utilize Arc online. Oct 10, 2013 at 21:06

2 Answers 2


You should get started with ArcGIS API for JavaScript. Using this tutorial will help you build your first application

  • I've been pouring over this for a long time now. But what I can't find is where to put the reference to my local service? This tutorial nicely skips over this. Oct 7, 2013 at 19:34
  • I also have no idea where to put the js file when I've written it. Oct 7, 2013 at 19:35
  • you would need to put the js/html/css files in the wwwroot folder on your server. Look through the ArcGIS Server help for more information: resources.arcgis.com/en/help/main/10.1/index.html#/…
    – Craig
    Oct 7, 2013 at 19:41
  • Ok, but my first problem still remains. How do I reference a local service? Oct 7, 2013 at 22:29

I'm assuming that you have a local Mapservice which is dynamic (i.e. not cached)

Please have a look at this sample: Dynamic map service

You will see that they are adding a map service using the following line of code:

var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", {

You need to provide the URL of the REST endpoint of your dynamic map service.

If the hostname of your server is myserver and the name of your service is say myMapService, you can use the following line of code:

var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
"http://myserver/ArcGIS/rest/services/myMapService/MapServer", {
          "opacity":1, /* 100 % opacity */

Not the answer you're looking for? Browse other questions tagged or ask your own question.