由于arcgis的官网被墙,所以特意留了一个SDK包的下载地址:https://download.csdn.net/download/qq_31672459/10301377,安装完成后的最后一步会有SDK所在目录,以及demo的目录。一般如下:
~/Library/SDKs/ArcGIS/iOS/Frameworks/Static/ArcGIS.framework
~/Library/SDKs/ArcGIS/iOS/Frameworks/Dynamic/ArcGIS.framework
~/Library/SDKs/ArcGIS/iOS/Samples
~/Library/Developer/Shared/Documentation/DocSets
~/Library/Application Support/AGSiOSRuntimeSDK
To uninstall the API and remove all content from your computer run uninstallAGSiOSSDK at:
~/Library/Application Support/AGSiOSRuntimeSDK
这一版的API与之前的10.+完全不同,所以用法也迥然不同,首先是加载地图、动态图以及渲染图层:
//加载底图
AGSArcGISTiledLayer *tileLayer =[AGSArcGISTiledLayer ArcGISTiledLayerWithURL:[NSURL URLWithString:@"http://地址/arcgis/rest/services/CJXCMap/YX2/MapServer"]];
self.map=[[AGSMap alloc]initWithBasemap:[AGSBasemap basemapWithBaseLayer:tileLayer]];
self.mapView.map=self.map;
//加载动态图层,一般该图层拿来展示元素以供展示管线数据、管控数据等,还有查询等用途
AGSArcGISMapImageLayer *dynamicLayer = [AGSArcGISMapImageLayer ArcGISMapImageLayerWithURL:[NSURL URLWithString:@"http://地址/arcgis/rest/services/CJXCMap/CJXCMapService/MapServer"]];
[self.map.operationalLayers addObject:dynamicLayer];
//渲染图层,一般拿来高亮显示用户点击的元素,便于操作
AGSGraphicsOverlay *overlayer = [[AGSGraphicsOverlay alloc]init];
[self.mapView.graphicsOverlays addObject:overlayer];
API的属性方法就不用赘述了,自行追踪查看。