Obtain Layer Type from list of layers

1756
0
12-07-2012 05:19 AM
KarenRobine
Occasional Contributor II
In the following example, after I get the layer, how can I tell what layer type it is?  Ie Tiled or Dynamic, or Feature? I know I can read it from what I startup the map with, but there must be another way..

Seems like an easy question, but I couldnt find it.. Thanks.

function getLayerProperties() {
  for(var j = 0; j < map.layerIds.length; j++) {
    var layer = map.getLayer(map.layerIds);
    alert(layer.id + ' ' + layer.opacity + ' ' + layer.visible);
  }
}
0 Kudos
0 Replies