Hi Roberto,
in 10.2.5 there is an easier way with webTiledLayers
- (IBAction)selectBaseMap:(id)sender {
[self.mapView removeMapLayer:self.wtl];
switch (((UISegmentedControl *)sender).selectedSegmentIndex)
{
case 0:
{
self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=m&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];
[self.mapView addMapLayer:self.wtl withName:@"Google street map"];
break;
}
case 1:
{
self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=p&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];
[self.mapView addMapLayer:self.wtl withName:@"Google terrain map"];
break;
}
case 2:
{
self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=y&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];
[self.mapView addMapLayer:self.wtl withName:@"Google hybrid map"];
break;
}
#warning[1568]
case 3:
{
self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"https://mts{subDomain}.googleapis.com/vt?lyrs=s&hl=en&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:nil];
[self.mapView addMapLayer:self.wtl withName:@"Google satellite"];
break;
}
}
}
regards,
David