vaibhav shah
vaibhav shah

Reputation: 5069

Add legends manually for graphic layer in arcgis javascript

In my arcgis map application I am adding legends for featurelayer like this

legendLayers.push({ layer: singleCityLayerFeature, title: cityLayers[i][1] });

This adds legends for that "CityLayer". FeatureLayer which I am using already have legends.

But I also have creating graphic layers which has different icons for graphics. How do I add these icons in legends with title just like legends added for feature layer.

Upvotes: 1

Views: 1142

Answers (1)

T Kambi
T Kambi

Reputation: 1387

You cannot create legends for GraphicLayers. The documentation clearly states which layers are supported.

The legend supports the following layer types: ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, FeatureLayer, CSVLayer, KMLLayer, and WMSLayer.

Upvotes: 1

Related Questions