I'm adding an AGSFeatureTableLayer that is based on an AGSGDBFeatureServiceTable. The layer shows up fine, but when I try to set the opacity I see no effect. The code is below. Could there be something with the feature service the table is loading from that would be preventing a change to opacity? Thanks.
mc.fieldsFeatureLayer = [[AGSFeatureTableLayer alloc] initWithFeatureTable:table];
mc.fieldsFeatureLayer.delegate = mc;
mc.fieldsFeatureLayer.selectionColor = [UIColor redColor];
[mc.fieldsFeatureLayer setOpacity:0.3];
[mc.mapView insertMapLayer:mc.fieldsFeatureLayer withName:fieldBoundaryLayerName atIndex:1];
Solved! Go to Solution.
I tested your code and the issue can be reproduced. I think the reason is that you need to set the opacity in the layerDidLoad method in delegate. That confirms your AGSFeatureTableLayer is loaded.
-(void)layerDidLoad:(AGSLayer *)layer{
if([layer isKindOfClass:[AGSFeatureTableLayer class]]){
AGSFeatureTableLayer* ftLayer = (AGSFeatureTableLayer*)layer;
[ftLayer setOpacity:0.2];
}
}
I tested your code and the issue can be reproduced. I think the reason is that you need to set the opacity in the layerDidLoad method in delegate. That confirms your AGSFeatureTableLayer is loaded.
-(void)layerDidLoad:(AGSLayer *)layer{
if([layer isKindOfClass:[AGSFeatureTableLayer class]]){
AGSFeatureTableLayer* ftLayer = (AGSFeatureTableLayer*)layer;
[ftLayer setOpacity:0.2];
}
}