ArcGIS Runtime SDK for iOS学习【2】- 图层加载&浏览

/ 0评 / 3

效果如下图所示:
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{}

发表评论

邮箱地址不会被公开。 必填项已用*标注