Tile Layer's SpatialReference wkid property gives null pointer exception?

468
3
06-11-2018 04:32 AM
VijitWadhwa
New Contributor III

When i take tile layer as a basemap, and try to retrieve it's spatial reference , it gives me Null Pointer Exception , whereas if i take raster file (tif) as base layer, I am able to get it's spatial reference same as that of map. There is a lot of confusion regarding the projection system of tile layer. How can i change the projection , so that i can see it in my MapView , coz on changing the Projection of map , the tile layer disappears. Thanks in advance

0 Kudos
3 Replies
dotMorten_esri
Esri Frequent Contributor

Did you call "await tileLayer.LoadAsync()"  on your tile layer before retrieving the spatial reference?

Also tile layers does not support re-projection, so they will only render if their spatial reference matches that of the map.

0 Kudos
VijitWadhwa
New Contributor III

No, I did not call the method , thanks for that .

How can I change the projection of tile layer while creating .tpk file ? As

there is no option in ArcGis desktop to add projection while creating .tpk

file ?

0 Kudos
dotMorten_esri
Esri Frequent Contributor
0 Kudos