From map.infoWindow, how would you retrieve the layer ID that the currently selected feature belongs to?

839
4
Jump to solution
10-06-2014 10:14 AM
AustinLasher
New Contributor II

When the user selects a feature on the map, I need to know which layer that feature belongs to. I've looked around a little bit through logs and on the API, but I haven't found a way to locate this. I suspect there's a simple answer, but I haven't been able to find it yet.

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Austin,

Take a look at this JS Fiddle.  When you click on the cities feature layer, a pop-up will display showing the feature layer ID.

View solution in original post

0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Austin,

Take a look at this JS Fiddle.  When you click on the cities feature layer, a pop-up will display showing the feature layer ID.

0 Kudos
KenBuja
MVP Esteemed Contributor

Your Fiddle was missing a closing "});". Fixed here.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Thanks, Ken.  Thought I fixed that, must have forgotten to hit update.

0 Kudos
AustinLasher
New Contributor II

Thanks a lot, I appreciate the accompanying JSFiddle. Very helpful!

0 Kudos