200字
ArcGIS Runtime SDK for iOS学习【2】- 图层加载&浏览
2013-03-19
2026-01-26
GIS
效果如下图所示: QQ20130319-4

1.在storyboard里绘制一个界面

添加UIView到界面里,class设为AGSMapView QQ20130319-7

QQ20130319-5 QQ20130319-6

2.添加事件和属性

@property (weak, nonatomic) IBOutlet AGSMapView *mapView;
//加载地图
        AGSTiledMapServiceLayer *tiledLayer =
        [AGSTiledMapServiceLayer
         tiledMapServiceLayerWithURL:[NSURL URLWithString: BJArcGISOnline]];
        [self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];
                cunrrentLayerNum = 0;
-(void) mapViewDidLoad:(AGSMapView *)mapView {
    // 开启GPS
    [self.mapView.locationDisplay startDataSource];
    self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeDefault;

    [self.mapView zoomToScale:50000 withCenterPoint:nil animated:YES];
    [self.autoPanModeControl setSelectedSegmentIndex:0];
图层加载完毕后,如果设置了AGSMapViewLayerDelegate, AGSLayerDelegate后,可以调用下面的方法。 - (void) layerDidLoad: (AGSLayer*) layer{}
ArcGIS Runtime SDK for iOS学习【2】- 图层加载&浏览
作者
Chuck
发表于
2013-03-19
License
CC BY-NC-SA 4.0

评论