Esri service legend generator

2106
1
Jump to solution
07-17-2018 07:42 AM
by Anonymous User
Not applicable

How do I generate a legend image for both ArcGIS Server and AGOL services for a Leaflet map?

Similar questions were raised in this posting:

How to get Legend Info from web map services 

I'm trying to do something similar but in the context of getting legend images for both ArcGIS Server and AGOL service REST endpoints.

I've attempted to use this leaflet plugin:
GitHub - w8r/esri-leaflet-legend: Esri leaflet plugin for retrieving map service legends. 

but on testing, it seems to only support legends from an Esri "legend" URL service endpoint. It appears that the "legend" service URL pattern is only available for services coming from ArcGIS Server (Enterprise) instances, but NOT from ArcGIS Online services. 

 

Also, not every "FeatureServer" hosted in AGOL (at arcgis.com) will have a corresponding "MapServer" REST endpoint, unlike what you see with a standard ArcGIS Server/Enterprise setup.

 

I'm really hoping that someone else can confirm if this assessment is correct, and that the "legend" service URL pattern is only available for standard ArcGIS Server REST endpoints (for both Feature or Map service layers) and NOT for ArcGIS Online services (of any service type).

 

If so, and if I still need to support legends for AGOL feature and map resources (not just for ArcGIS Server/Enterprise resources), how do I generate the legend image for use in a web map interface (perhaps using Leaflet, or some other framework)? We're not planning on using any Dojo/JSAPI components...

 

In the AGOL REST service endpoints, there is a Drawing Info Renderer JSON object with all the necessary ingredients (symbol type, colors, sizes, etc), but it would be nice not to have to roll my own legend generator for AGOL services...

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

I resolved this with help from a separate, older thread. I posted some comments on this solution here:
https://community.esri.com/thread/190486-how-to-get-legend-info-from-web-map-services#comment-809626 

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable

I resolved this with help from a separate, older thread. I posted some comments on this solution here:
https://community.esri.com/thread/190486-how-to-get-legend-info-from-web-map-services#comment-809626 

0 Kudos