Hello
I've checked for more details as follows:
// Check the renderer of feature layer
if ([featLayer.renderer isKindOfClass:[AGSUniqueValueRenderer class]])
{
NSLog(@"AGSUniqueValueRenderer");
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]])
{
NSLog(@"j %d; label %@; AGSPictureMarkerSymbol", j, value.label);
AGSPictureMarkerSymbol *pms = (AGSPictureMarkerSymbol *)value.symbol;
info.image = [pms swatchForGeometryType:featLayer.geometryType size:CGSizeMake(8, 8)];
NSLog(@"symbol: %@", [value.symbol encodeToJSON]);
}
else
{
NSLog(@"j %d; label %@; NOT AGSPictureMarkerSymbol", j, value.label);
info.image = [value.symbol swatchForGeometryType:featLayer.geometryType size:CGSizeMake(20, 20)];
NSLog(@"symbol: %@", [value.symbol encodeToJSON]);
}
info.name = value.label;
[self.legendInfos addObject:info];
}
}
Notes:
1. For AGSPictureMarkerSymbol:
symbol: {
angle = 0;
color = "<null>";
height = 12;
imageData = "<null>";
imageName = "<null>";
type = esriPMS;
width = 12;
xoffset = 0;
yoffset = 0;
}
2. For NON-AGSPictureMarkerSymbol:
symbol: {
angle = 0;
color = (
0,
0,
128,
128
);
outline = {
color = (
0,
0,
128,
255
);
style = esriSLSSolid;
type = esriSLS;
width = 1;
};
rotateAroundOffset = false;
size = 12;
style = esriSMSDiamond;
type = esriSMS;
xoffset = 0;
yoffset = 0;
}
So, it seems that AGSPictureMarkerSymbol is not returning an image unlike AGSSimpleMarkerSymbol. Is there any way to get the image for AGSPictureMarkerSymbol?
Thanks.
Rgds
Ong CF