Hello.I have a source of tiles with the following URL format:http://tiles.XXXX.com/map/lv10/00/000/000/616/000/000/700.png?key=XXXXXXI know how to work with that kind of URLs with OpenLayers, but I can't find a way to make it with ArcGIS API for Javascript.The tiles are in World Mercator spatial refference (EPSG:3395)Should I use the WebTiledLayer or something else?-------------That is how it's done with OpenLayers:
<script defer="defer" type="text/javascript">
var CENTER = {
LON: 4187123.4301231, LAT: 7471123.1641231
};
function getTileURL(bounds) {
var coords = bounds.getCenterLonLat()
, resolutions = ['dummy'
, 78271.51696484375,
39135.758482421875,
19567.8792412109375,
9783.93962060546875,
4891.969810302734375,
2445.9849051513671875,
1222.99245257568359375,
611.496226287841796875,
305.7481131439208984375,
152.87405657196044921875,
76.437028285980224609375,
38.2185141429901123046875,
19.10925707149505615234375,
9.554628535747528076171875,
4.7773142678737640380859375,
2.38865713393688201904296875,
1.194328566968441009521484375
]
, fMinX = -20037508.343
, fMinY = -19930481.933
, zoom = this.map.getZoom()
, fTileSizeMerc = resolutions[zoom] * 256
, x = parseInt((coords.lon - fMinX) / fTileSizeMerc)
, y = parseInt((coords.lat - fMinY) / fTileSizeMerc);
var a = 'http://tiles.XXXX.com/map/' + 'lv' + (zoom +'00'+ (1000000000 + x).toString().substr(1)
+ (1000000000 + y).toString().substr(1)).replace(/^(\d{1,2})00(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})/
, '$1/00/$2/$3/$4/$5/$6/$7')
+ '.png?key=XXXXXX';
return a;
}
var map = new OpenLayers.Map('map')
, xxMapBounds = new OpenLayers.Bounds(-20037508.343, -19930481.933, 20037508.343, 20144534.753)
, params = {
maxExtent: xxMapBounds,
getURL: getTileURL,
numZoomLevels: 18,
transitionEffect: "resize",
maxResolution: 156543.03390625,
attribution: '<a href="http://XXXXX/">XXXXX JSAPI</a>'
}
, xxMaps = new OpenLayers.Layer.OSM("XXXXX", 'http://XX.tiles.XXXXX.com/map/', params);
map.addLayers([xxMaps]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
map.setCenter(new OpenLayers.LonLat(CENTER.LON, CENTER.LAT), 10);
</script>
Thanks