Discussion created by cmahlke on Sep 8, 2011
Latest reply on Mar 7, 2018 by njarecha-esristaff
This question is concerning layer definitions.

I follow the sample code snippets posted at the very bottom of this page:

Here is my code:

AGSDynamicMapServiceLayer *dyn = [[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:@""]];
int layerID = 3; 
NSString *defString = @"NAME = 'Middlesex County'";
AGSLayerDefinition *layerDef = [AGSLayerDefinition layerDefinitionWithLayerId:layerID definition:defString];
dyn.layerDefinitions = [NSArray arrayWithObject:layerDef];
[mapView removeMapLayerWithName:@"previous layer"];
self.fbMapServiceUIView = [mapView addMapLayer:_dyn withName:@"some name"];

Instead of just 4 counties being loaded, the entire choropleth map is being loaded as though there were no layer definitions being applied.

Has anyone out there successfully applied layer definitions?  Any suggestions?