AnsweredAssumed Answered

undefined legend from FeatureLayer (QML)

Question asked by frigerius on Apr 20, 2016
Latest reply on Apr 20, 2016 by LDanzinger-esristaff


Hey,

 

I'm creating FeatureLayers with ArcGISRuntime.createObject("FeatureLayer"). Then I fill the layers feature Table with information from an offline geodatabase by geodatabaseFeatureTableByLayerId(i). Afterwards I add them to my Map by addLayer.

My Problem is that I now want to access layers legend list to get their legendItems image. (layer.legend[0].legendItems[0].image) To ensure that all layers are constructed I wait until all Layers are displayed and then I click a button which runs a function to get the images of my layers. Console output said that there is no legend added to my FeatureLayer(ArcGIS.Runtime.Layer: class QQmlListProperty<class QmlLayerLegendInfo> __cdecl QmlLayer::legend(void) count= 0) but I think that there should be one because the layers get displayed in different colors.

 

Don't know if this is a bug or if I just did smth. wrong. My target is to get the layers color or image information to display it in a legend.

Outcomes