layer name in legend

3281
2
11-19-2014 03:26 AM
New Contributor

good Morning

In my app I use the example "Legend Sample". I use a AGSDynamicMapService containing many layers. When I create the legend, in my leganda shows only the details of the layers, but not the name of the individual layers. I would like to know if there is a method that allows me to enter the name of the layers in the Header section TableView. In image, show the legend for a AGSDynamicMapService with three layers. The first two are not themed, the third layer is themed. In the first two layers appears only the image, but not the layer name

thanks1.tiff

Reply
0 Kudos
2 Replies
by
Regular Contributor

Hi Luca,

In my view, Runtime iOS SDK is an interface to read the metadata from ArcGIS Server. I don't think the SDK can overwriting the Legend label from, in order to let your first two layers show the label name for the legend. I would suggest to check ArcMap and Right click those layer and choose properties -- symbology and add the label to this legend.

Here I attached a screenshot for you as a reference.

Hope this can help.

Legend_label.JPG

REST_Point.JPG

Reply
0 Kudos
New Contributor

Thanks for the reply. The service ArcGIS Service is not my service, but it is a service created by the region of Sicily. I can not change the original project ArcMap. I found a solution. I load individually FeatureLayer that constitute the AGSDynamicMapServive with this code:

for(int i=0;i<[nome count];i++){

                        NSString *url = [NSString stringWithFormat:@"%@/%i",servizio, i];

                        AGSFeatureLayer *featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:url] mode:AGSFeatureLayerModeOnDemand];

                        [self.mapView addMapLayer:featureLayer withName:[nome objectAtIndex:i]];

                        self.legendDataSource = [[LegendDataSource alloc] initWithLayerTree:[[AGSMapContentsTree alloc]initWithMapView:self.mapView manageLayerVisibility:YES]];

                        NSLog(@"%@", url);

                    }

where nome in Array of featureLayer of AGSDynamicMapService

Reply
0 Kudos