AnsweredAssumed Answered

Using map.setBasemap(); for web tiled layers

Question asked by RWinter85 on Aug 10, 2015
Latest reply on Aug 11, 2015 by RWinter85

I am just curious if it is possible to use web tile layers such as stamen or mapbox through:

map.setBasemap('myBasemap');

 

I know I can do something like this to get it to recognize me calling map.setBasemap('myBasemap'):

 

esri.basemaps['myBasemap'] = {
  baseMapLayers: [{
    url: 'http://{subDomain}.tile.stamen.com/watercolor/{level}/{col}/{row}.jpg'
  }],
  title: 'My Layer'
};

 

but the problem with this is it obviously wont treat the url as a tiled layer and ends up looking for something like the following:

 

http://%7Bsubdomain%7D.tile.stamen.com/watercolor/%7Blevel%7D/%7Bcol%7D/%7Brow%7D.jpg

 

Is there a good way to get the map to recognize tiled layers this way?

 

I am trying to avoid adding this as a web tiled layer on top of a basemap as I would like to add this to a custom basemap gallery and to be able to use this layer the same way as other basemaps via map.setBasemap().

Outcomes