WebTiledLayer v ServiceImageTiledLayer

03-09-2018 07:48 AM
New Contributor III


I've been able to perform the same action using the two layers specified. I give both of them a URL and it retrieves the tiles from a service.

Could someone please explain the difference between them?

0 Kudos
1 Reply
Esri Contributor

The secret lies in the class hierarchy. ServiceImageTiledLayer is an abstract class that implements the basic functionality for fetching map tiles from a remote service. Of course, being abstract you can't instantiate an instance of ServiceImageTiledLayer, you need a concrete class for that. Enter WebTiledLayer - a sealed class (cannot be derived from) that is derived from ServiceImageTiledLayer and provides a concrete class that can be used for generically accessing tiles from a remote service.

So, if you have a custom service that provides map tiles you can either use the concrete WebTiledLayer if the tile structure permits. Or, if you need something more custom, you can derive your own class from ServiceImageTiledLayer and override the GetTileUriAsync method and adjust the tile URL structure as needed.

See this thread: https://community.esri.com/thread/187238-how-do-i-add-an-wmts-layer for a simple OpenStreetMap example.