Hi All,
I'm working on project which is related to ARCGIS server on iPad. So in my application I'm trying to load 3 feature layers on basemap. I'm able to do that. But problem is like not overtime it get loaded and second thing is how can I get more information about feature layer which has data in it.
Below is the code which I used to show layers on map.
// Add basemap.
NSURL* url = [NSURL URLWithString: @"http://services.arcgisonline.com/arcgis/rest/services/World_Topo_map/mapserver"];
AGSTiledMapServiceLayer* layer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL: url];
layer.delegate = self;
[self.mapView addMapLayer:layer withName:@"Streets"];
//zoom to an area
AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-1.34732920649E7 ymin:4533851.309500001 xmax:-1.3431785844E7
ymax:4641521.468800001 spatialReference:self.mapView.spatialReference];
[self.mapView zoomToEnvelope:envelope animated:NO];
// Structures.
NSString *urlString = [self.currentWorkOrder.detectionURL substringToIndex:[self.currentWorkOrder.detectionURL length]-1];
self.featureLayerURL0 = [NSURL URLWithString:[NSString stringWithFormat:@"%@0",urlString]];
self.featureLayer0 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL0 mode:AGSFeatureLayerModeOnDemand];
self.featureLayer0.delegate = self;
[self.mapView addMapLayer:self.featureLayer0 withName:@"CloudData0"];
// Alignment.
self.featureLayerURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@1",urlString]];
self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL mode:AGSFeatureLayerModeOnDemand];
self.featureLayer.delegate = self;
[self.mapView addMapLayer:self.featureLayer withName:@"CloudData"];
// Detections.
self.featureLayerURL1 = [NSURL URLWithString:[NSString stringWithFormat:@"%@2",urlString]];
self.featureLayer1 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL1 mode:AGSFeatureLayerModeOnDemand];
self.featureLayer1.delegate = self;
PO(self.featureLayer1.fields);
[self.mapView addMapLayer:self.featureLayer1 withName:@"CloudData1"];
If anyone has any idea. Please help me out.
Thanks in advance.
I'm not very clear about your first issue. Does it means it takes a long time to load the three layers?
Here is the API reference for AGSFeatureLayer:
10.2.4: AGSFeatureLayer Class Reference
You can go through the method and properties and see if there is information you need. If not, you can also do a query on the layer and get the information you want.