天天看点

arcgis地图加载离线地图

// 显示基础地图

NSArray *bundleVtpk =[[NSBundle mainBundle] pathsForResourcesOfType:@".vtpk" inDirectory:nil];

NSURL *pathUrl1 = [[NSURL alloc]initFileURLWithPath:[bundleVtpk objectAtIndex:0]];

// 设置代理

self.mapView.touchDelegate = self;

AGSArcGISVectorTiledLayer *tiledLayer = [[AGSArcGISVectorTiledLayer alloc]initWithURL:pathUrl1];

AGSBasemap *basemap =[AGSBasemap basemapWithBaseLayer:tiledLayer];

// 去除水印

AGSLicenseResult *licenseResult = [AGSArcGISRuntimeEnvironment setLicenseKey:@“runtimelite,1000,rud5799562951,none,PM0RJAY3FLLR2B3TR001” error:nil];

self.mapView.map = [[AGSMap alloc] initWithBasemap:basemap];

self.mapView.interactionOptions.rotateEnabled = NO;

self.mapView.locationDisplay.showLocation = YES;

self.mapView.locationDisplay.showPingAnimationSymbol = NO;//取消闪烁的光圈

self.mapView.locationDisplay.showAccuracy = NO;//取消闪烁的光圈

self.mapView.locationDisplay.wanderExtentFactor = 0;

self.mapView.attributionTextVisible = false;

// 加载业务操作图层

self.operationLayer = [[AGSArcGISMapImageLayer alloc] initWithURL:[NSURL URLWithString:QingpuRiverServerURL]];

[self.mapView.map.operationalLayers addObject:self.operationLayer];//加载操作业务图层

//设置默认显示区域

AGSEnvelope *envelope = [[AGSEnvelope alloc]initWithXMin:Map_XMin yMin:Map_YMin xMax:Map_XMax yMax:Map_YMax spatialReference:[AGSSpatialReference spatialReferenceWithWKID:4326]];

_avp=[[AGSViewpoint alloc]initWithTargetExtent:envelope];

self.mapView.map.initialViewpoint = _avp;

继续阅读