Where is tileInfo property?

781
3
Jump to solution
01-10-2012 04:53 AM
miguelde_la_roda
New Contributor
Hello!

If I declare a ArcGISTiledMapServiceLayer

var tiledMapServiceLayer  = new esri.layers.ArcGISTiledMapServiceLayer(routeMap); var num_levels = tiledMapServiceLayer.tileInfo.lods.length;


the new object tiledMapServiceLayer does not contain tileInfo property. Why? Do I need to configure ArcGIS Server?

Thank you!
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
You need to wait until the layer is loaded. If this is the basemap you are adding you can listen for the map's onLoad event and check the tileInfo then. Here's a snippet that shows how this works:


         basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");                  dojo.connect(map,'onLoad',function(){            console.log(basemap.tileInfo.lods.length);         })         map.addLayer(basemap);

View solution in original post

0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
You need to wait until the layer is loaded. If this is the basemap you are adding you can listen for the map's onLoad event and check the tileInfo then. Here's a snippet that shows how this works:


         basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");                  dojo.connect(map,'onLoad',function(){            console.log(basemap.tileInfo.lods.length);         })         map.addLayer(basemap);
0 Kudos
miguelde_la_roda
New Contributor
Thank you, Kelly!
0 Kudos
AdrianMarsden
Occasional Contributor III
..and thank you from me.  I have been playing with this code

http://warblingdiode.blogspot.co.uk/2010/02/watermarking-your-maps-with-esri-arcgis.html?m=1

To add watermarks - I was putting it all in the init function, rather than the onload - saw this post, moved it, and it all works.  Now of course Esri will probably add a watermark feature in the next release or something, but who cares 😄

ACM
0 Kudos