Select to view content in your preferred language

AGSWMTSLayer is loaded but invisible. Can any one help me ?

3894
2
Jump to solution
02-03-2015 02:49 AM
RoshnaDsouza
Deactivated User

- (void)startWMTSLayerSetUp

{

    NSString *wmtsUrl = [[[DataManager sharedInstance] getWMTSInfoUrl] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

   

    if (!wmtsUrl) return;

   

    self.wmtsInfo = [[AGSWMTSInfo alloc] initWithURL:[NSURL URLWithString:wmtsUrl]];

    self.wmtsInfo.delegate = self;

}

- (void)wmtsInfoDidLoad:(AGSWMTSInfo *)wmtsInfo

{

    NSArray *layerInfos = [wmtsInfo layerInfos];

    for (AGSWMTSLayerInfo *layerInfo in layerInfos) {

 

        self.wmtsLayer = [wmtsInfo wmtsLayerWithLayerInfo:layerInfos[0] andSpatialReference:self.mapView.spatialReference];

       

        self.wmtsLayer.delegate = self;

       

        NSUInteger value = [layerInfos indexOfObjectIdenticalTo:layerInfo];

        [self.mapView insertMapLayer:self.wmtsLayer withName:layerInfo.title atIndex:value];

    }

}

Here is the url I use https://show.msgis.net/wmts/basemap-WMTSCapabilities.xml

blank map grid view is shown. and delegates say that the layers are loaded .

Same functionality works perfectly fine for this url http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/1.0.0/WMTSCapabil... 

0 Kudos
1 Solution

Accepted Solutions
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

This thread is old, however I would like to share some information that I found about how to load an open source WMTSLayer in ArcGIS Runtime for iOS in Objective-c.

For more information, please check this github sample page that I show how to load the WMTSLayer from an open source.

Read Offline GDB With WMTSLayer as basemap 

Hope this can help.

View solution in original post

2 Replies
RoshnaDsouza
Deactivated User

With future research I found that the request URL formed to get the tile data were inappropriate.

Request template: http://maps1.wien.gv.at/basemap/bmaphidpi/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg

/basemap/bmaphidpi/normal/google3857/8/88/134.jpeg (Request URL formed on Android)

/basemap/default/bmaphidpi/google3857/2/2/1.jpeg (Request URL formed on Android)

Also Tried to fix this by SubClassing AGSWMTSLayer , overriding

-(void)requestTileForKey:(AGSTileKey*)key and  -(NSURL*)urlForTileKey:(AGSTileKey*)key

where I try to manipulate the URL to replicate the Android Url in turn returning success response , but still the tile data isn't visible.

Any clue on why this happens ?

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

This thread is old, however I would like to share some information that I found about how to load an open source WMTSLayer in ArcGIS Runtime for iOS in Objective-c.

For more information, please check this github sample page that I show how to load the WMTSLayer from an open source.

Read Offline GDB With WMTSLayer as basemap 

Hope this can help.