Loading web tiles with overloaded constructor

290
1
01-01-2022 09:14 AM
TasawarAhmad
New Contributor III

Hi,

1-  I have been able to load web tiles by following this tutorial: ArcGIS WebTiles 

2- The default constructor, fetches and displays web tiles in WebMercator spatial reference.

3- As per my use case, I need to fetch and display these tiles in WGS 84 spatial reference, so that to avoid reprojection performance overhead (for my other rasters which I have in WGS84).

4- I have tried using the overloaded constructor, but to no avail. Can you guide me up on how to load the web tiles (link provided in arcgis tutorial) in WGS84?

I have tried using overloaded constructor like this:

 

string _templateUri = "https://stamen-tiles-{subdomain}.a.ssl.fastly.net/watercolor/{level}/{col}/{row}.jpg";

TileInfo tilesInfo= new TileInfo(96, TileImageFormat.Png, levelOfDetails, new MapPoint(-185, 85, SpatialReferences.WGS84), SpatialReferences.Wgs84, 256, 256);

WebTiledLayer myBaseLayer = new WebTiledLayer(_templateUri, tilesInfo, new Envelope(new MapPoint(-185, -85, SpatialReferences.WGS84),new MapPoint(185, 85, SpatialReferences.WGS84)));

Basemap layerBasemap = new Basemap(myBaseLayer);
Map myMap = new Map(layerBasemap);
MainMapView.Map = myMap;

 

 

For testing purposes,I have manually created levelOfDetails by this:

 

WebTiledLayer arcgisTutorialBaseLayer = new WebTiledLayer(_templateUri, _tiledLayerSubdomains);
List<LevelOfDetail> levelOfDetails = (List<LevelOfDetail>)arcgisTutorialBaseLayer.TileInfo.LevelsOfDetail;

 

 

0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor

The ability to use tiled basemaps in a specific spatial reference system depends on those services being available in that spatial reference. ArcGIS basemaps are available in both Web Mercator and WGS 84:

ArcGIS Online Basemaps 

World Basemaps (WGS84) 

0 Kudos