Store | Contact Us | Careers
 
  • Home
  • Industries
  • Products
  • Training
  • Support
  • Services
  • Events
  • News
  • About
    • About Esri
    • Careers
    • Esri Video
    • Partners

Support

Search Support
You are here: > ArcScripts > Search Results > Script Details Login | Feedback | Help

Custom REST Service - Map Service Legends



contact author | download help | report inappropriate content
Author ArcGIS Server Development Team
File Name restlegends.v2.zip
Language JavaScript
Last Modified Feb 9 2010
Status of work ESRI Attribution and Licensing Agreement
Software ArcGIS Server (10.0 and prior)
File Size 25 bytes
Downloads 2213

ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.


Summary
The ArcGIS Server REST API does not support map service legends. The SOAP API does. This is a custom REST service written in Java that provides this functionality.

Web clients (JavaScript, Flex, etc.) can use the JSON response of this service to include legends in their applications.

[UPDATE #3: The .NET version of this sample is available here: http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=16800]

[UPDATE #2: Fixed a bug with null legend classes reported by Dave Bouwman.]

[UPDATE: The dev summit demos from the advanced JS API session are available in this code gallery. It includes a simple JS client that accesses this custom service. Download the samples from here: http://resources.esri.com/arcgisserver/apis/javascript/arcgis/index.cfm?fa=codeGalleryDetails&scriptID=16092 ]

This service supports 3 parameters:

soapUrl - Required. URL of the SOAP endpoint of the map service.

f - The response format: html, json, pjson (pretty json). The default format is html.

callback - The JavaScript callback method for the JSON response.

This service uses the JSON in Java library from: http://www.json.org/java/

It also uses the ArcGIS Server SOAP client library that you can reference from your ArcGIS Server installation.
Contact Us | Privacy | Legal | Site Map