// set the delegate for the map view
self.mapView.layerDelegate = self;
//create an instance of a tiled map service layer
AGSTiledMapServiceLayer *tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:@"http://www.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer"]];
//Add it to the map view
[self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];
//动态图层,使用ArcGIS Online的全球人口数据
NSString *str_URL_1 =
@"http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer";
NSURL *url_Dynamic = [NSURL URLWithString:str_URL_1];
AGSDynamicMapServiceLayer *dynamicLyr = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:url_Dynamic];
[self.mapView addMapLayer:dynamicLyr withName:@"Population Layer"];
//加载本地切片
AGSLocalTiledLayer *localLayer=[AGSLocalTiledLayer localTiledLayerWithName:@"peituxin"];
[self.mapView addMapLayer:localLayer withName:@"Local Layer"];
iOS交流群:438651997,欢迎加入讨论