what is a better way to get all graphicsLayer (not feature layer) only?

1776
1
Jump to solution
06-28-2016 07:34 AM
Alexwang
Occasional Contributor II

which one is better? or are there any better ways of doing this? thanks,

if ( map.getLayer(map.graphicsLayerIds).type != "Feature Layer")

or

if ( !map.getLayer(map.graphicsLayerIds).hasOwnProperty("type"))

or

.....

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
XiaodongWang
Esri Contributor

Try it:

if ( map.getLayer(map.graphicsLayerIds).declaredClass === "esri.layers.GraphicsLayer")

View solution in original post

0 Kudos
1 Reply
XiaodongWang
Esri Contributor

Try it:

if ( map.getLayer(map.graphicsLayerIds).declaredClass === "esri.layers.GraphicsLayer")
0 Kudos