1

Using esri javascript api version 3.8, I am trying to use some cached tiles from our server at http://hexe.er.usgs.gov/ifhp/will/tiles/ using WebTiledLayer. I believe that our tiles are set up as ${level}/${row}/${col}.png , however my tiles still aren't showing up. Does this have something to do with setting up an extent parameter? I'd like the tiles to show up with the extent of 'xmin': -88.243751, 'ymin': 41.49263, 'xmax': -88.131789, 'ymax': 41.727235

This sample is the only example I've found that uses a web tile cache and it doesn't use the extent parameter but its a world map whereas mine is a small county in Illinois. I haven't found any examples of using the extent option so maybe I just don't have it set up correctly.

Here's my code snippet with the attempt at the extent parameter.

var tiles = new WebTiledLayer("http://hexe.er.usgs.gov/ifhp/will/tiles/overlay10/${level}/${row}/${col}.png", {
    "Extent": "'xmin': -88.243751, 'ymin': 41.49263, 'xmax': -88.131789, 'ymax': 41.727235"
});
map.addLayer(tiles);
2
  • 1
    hexe.er.usgs.gov not responding. The link is correct?
    – lele3p
    Commented Jan 28, 2014 at 12:57
  • That's the public facing part of our internal server. Viewing our directory might not be allowed for security reasons. Sorry, I thought it was publicly available. I don't think that should affect using the files though, you just can't view the directory.
    – daniella
    Commented Jan 28, 2014 at 15:51

1 Answer 1

1

The WebTiledLayer is hardcoded to work with tile sets that are in web mercator. It's not easily possible to use that class with a tile set that uses something other than web mercator (such as wgs84).

To use your tiles in an arcgis js api app, you should create a custom layer.

4
  • @Derek_Swingley So, is the web mercator something you set up when making the tiled map cache? and does creating the custom layer work around this issue?
    – daniella
    Commented Jan 28, 2014 at 19:34
  • @user1634292 yes, you specify the spatial reference for your tiles when you create them. How you do this varies on the tool(s) you're using. Commented Jan 28, 2014 at 23:05
  • @Derek_Swingley Sorry it took me awhile to get back to you, I'm pretty sure the tiles use wgs84. The first line of the xml document in the tile cache directory at hexe.er.usgs.gov/ifhp/will/tiles/conf.xml says "WGS_1984_Web_Mercator_Auxiliary_Sphere"
    – daniella
    Commented Jan 30, 2014 at 15:42
  • They ended up going with google maps...thanks for the help! I thought it said it was set in web mercator. I guess not.
    – daniella
    Commented Mar 28, 2014 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.