I have downloaded the latest ArcGIS iOS SDK and i was trying to modify the demo to access a WMTS service, my code is posted as below:
- (void)viewDidLoad {
[super viewDidLoad];
// 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:kTiledMapServiceURL]];
//
// //Add it to the map view
// [self.mapView addMapLayer:tiledLayer withName:@"Tiled Layer"];
wmtsSrv = [[AGSWMTSInfo alloc] initWithURL:[NSURL URLWithString:kWMTSMapServiceURL]];
wmtsSrv.delegate = self;
//release to avoid memory leaks
//create an instance of a dynmaic map layer
// self.dynamicLayer = [[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:kDynamicMapServiceURL]];
//
// //set visible layers
// self.dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:2], nil];
//
// //name the layer. This is the name that is displayed if there was a property page, tocs, etc...
// [self.mapView addMapLayer:self.dynamicLayer withName:@"Dynamic Layer"];
//
// //set transparency
// self.dynamicLayer.opacity = 0.2;
}
- (void)wmtsInfoDidLoad:(AGSWMTSInfo *)wmtsInfo
{
AGSWMTSLayerInfo *wmtsLayerInfo = [wmtsInfo.layerInfos objectAtIndex:0];
wmtsLayerInfo.tileMatrixSet = @"TileMatrixSet_0";
AGSSpatialReference *spatialRef = [[AGSSpatialReference alloc] initWithWKID:4326];
AGSWMTSLayer *wmtsLayer = [wmtsInfo wmtsLayerWithLayerInfo:wmtsLayerInfo andSpatialReference:spatialRef];
[self.mapView addMapLayer:wmtsLayer withName:@"WMTS Layer"];
}
after running the code above, i can only see the grid view without any tile images, so is there anyone can help me on this? Thanks in advance!!
... View more