AGSDynamicMapServiceLayer *dyn = [[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:@"http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_1990-2000_Population_Change/MapServer"]]; 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"];
Hi Nimesh Jarecha,
I didn't find the `AGSLayerDefinition` class in latest runtime SDK for iOS. How to accomplished this in Latest arcgis runtime SDK for iOS.
Regards,
For latest SDK (ver 100.x) property is renamed to `definitionExpression` and is available on sub layers, feature layer and service feature table. Please see below image.
The sample is available at arcgis-runtime-samples-ios/arcgis-ios-sdk-samples/Features/Feature layer definition expression at ma...
Hope this helps!
Regards,
Nimesh