AnsweredAssumed Answered

Get image for legend

Question asked by s26761 on Sep 3, 2012
Latest reply on Sep 6, 2012 by njarecha-esristaff
Hello

I've been trying to show a legend with info from a AGSUniqueValueRenderer as follows:

            AGSUniqueValueRenderer *renderer = (AGSUniqueValueRenderer *)featLayer.renderer;
            int num = [renderer.uniqueValues count];
            for (int j = 0 ; j < num ; j++)
            {
                LegendInfo *info = [[[LegendInfo alloc] init] autorelease];
                AGSUniqueValue *value = [renderer.uniqueValues objectAtIndex:j];
                if ([value.symbol isKindOfClass:[AGSPictureMarkerSymbol class]])
                {
                    AGSPictureMarkerSymbol *pms = (AGSPictureMarkerSymbol *)value.symbol;
                    info.image = [pms swatchForGeometryType:featLayer.geometryType size:CGSizeMake(24, 24)];                
                }
                else
                {
                    info.image = [value.symbol swatchForGeometryType:featLayer.geometryType size:CGSizeMake(20, 20)];                   
                }
                info.name = value.label;
                [self.legendInfos addObject:info];
            }

And to show the details in a table view. The 'value.label' is listed correctly. Images from AGSPictureMarkerSymbol do NOT appear but image from a AGSSimpleMarkerSymbol shows correctly.

Anyone knows how to make the images from AGSPictureMarkerSymbol to show correctly in a table view? The webmap is showing AGSGraphic using the correct symbols accordingly.

Thanks.

Rgds
Ong CF

Outcomes