4

I have been creating some web-map applications using GoogleMaps Javascript API v3.

I've been bringing in tiles from ArcGIS servers which is really easy using the API.

The code below loads a sample dataset from ArcGIS.com.

var url = 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer';
var agsType = new  gmaps.ags.MapType(url,{name:'ArcGIS'});
map.mapTypes.set('arcgis', agsType);
map.setMapTypeId('arcgis');

I have some clients that already have a public ArcGIS server online and in place. When I ask them for the MapServer URL, they don't know where to find it or how to generate it for their datasets.

I don't know anything about ArcGIS server and have not been able to find the appropriate info in ESRI help docs.

Could someone point me to some info about generating an appropriate MapServer URL that I could then pass onto my clients?

1 Answer 1

5

By default, ArcGIS Server for Java listens on port 6080 and its REST services directory is accessible at the path /arcgis/rest/services. So, given a host name, chances are you can browse its services directory using the following URL structure:

http://server.example.com:6080/arcgis/rest/services

From there, you'll find a list of services and/or folders with services in them. The path to a service's MapServer follows this format:

http://server.example.com:6080/arcgis/rest/services/foldername/servicename/MapServer

or, if it's not in a folder at all, just:

http://server.example.com:6080/arcgis/rest/services/servicename/MapServer

EDIT: As mwalker pointed out below, this is only the case for the Java version of ArcGIS Server. The .NET version listens on port 80 via IIS, so the base URL should simply be:

http://server.example.com/arcgis/rest/services

EDIT #2: It looks like at version 10.1 of ArcGIS Server, both the Windows and Linux versions listen on port 6080 by default. If you want another port to be used, you need to install the ArcGIS Server Web Adaptor. For more information, see: http://resources.arcgis.com/en/help/main/10.1/index.html#/Migration_to_ArcGIS_10_1_for_Server/0154000002p0000000/

5
  • 1
    ArcGIS Server for Java listens on port 6080 (if you don't have the web connector). ArcGIS Server for .NET goes into IIS and listens on port 80, so remove the :6080 for that.
    – mwalker
    Commented Jun 13, 2012 at 16:39
  • Thanks. Here is a arcServer I found on the web. How could I find the URLs to some of the layers on this server? I do not see an explicit ArcGIS server URL when viewing this map. gis.gallatin.mt.gov/general_viewer
    – jotamon
    Commented Jun 13, 2012 at 18:04
  • @mwalker, thanks for clarifying about .NET. snowgage, I just took a guess and plugged in /arcgis/rest/services to the base hostname and it took me to the REST services directory: gis.gallatin.mt.gov/arcgis/rest/services
    – greenlaw
    Commented Jun 14, 2012 at 19:32
  • Also, these services will only show in a browser if the ArcGIS Server Admin has enabled web access (which is default to be enabled).
    – MLowry
    Commented Jun 14, 2012 at 19:50
  • But how do I get a Host name for particular credentials? I am publishing my maps on ArcGIS.com but on what host name are they being published? How can I get that hostname information in c#?
    – WAQ
    Commented Oct 14, 2014 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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