URL of a MapLayer

765
1
Jump to solution
08-16-2012 08:05 AM
RickJones
Occasional Contributor II
How do I get the URL of an AGSLayer (FeatureLayer, DynamicLayer) object?

I can't find the property or method.


ie. add a bunch of layers via an Add Layer panel.
    Later, a method wants to list the names and urls of the MapLayers.
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
You'll have to check the type of layer and then cast layer to the respective type to get the URL. Like this...

if ([layer isKindOfClass:[AGSFeatureLayer class]]) {
    AGSFeatureLayer *fl = (AGSFeatureLayer*)layer;
    NSLog(@"Feature Layer URL: %@",fl.URL);
}

Regards,
Nimesh

View solution in original post

0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
You'll have to check the type of layer and then cast layer to the respective type to get the URL. Like this...

if ([layer isKindOfClass:[AGSFeatureLayer class]]) {
    AGSFeatureLayer *fl = (AGSFeatureLayer*)layer;
    NSLog(@"Feature Layer URL: %@",fl.URL);
}

Regards,
Nimesh
0 Kudos