get legends for hosted feature layer

601
1
09-09-2021 01:08 PM
Labels (1)
MichaelWen
New Contributor II

Is there a way to get the legends of an AGOL hosted feature layer by calling a url, and have the legend returned in a JSON? In ArcGIS Map Services that can be done by appending /legend to the url.

0 Kudos
1 Reply
mdonnelly
Esri Contributor

I don't believe this functionality is available for Feature services, just Map Image and Image services.

Feature services, unlike Map Image services, send geometries over to the client for rendering. This lends the default symbology to be overridden by the client. This might be why the REST api doesn't place importance on the default legend.

Regards,
Mark