Select to view content in your preferred language

ID of a point

1068
4
07-25-2013 02:03 AM
Dianede_lanfranchi
Emerging Contributor
Hi,

I'd like to get the ID of a point on my map to be able to call a function every time someone clicks on one of this point.
Problem is, I actually found nothing on the API to be able to do that, + I don't really know if thats the right way to do it.

The function calling would help me to display datas next to the maps. Each point would give different data of course.


Thanks.
0 Kudos
4 Replies
ManojrajTeli
Deactivated User
What have you tried so far and from where this points are coming like feature layer,graphics.Which version of javascript API are you using? Please elaborate the problem.
0 Kudos
JasonZou
Frequent Contributor
If the point is a point feature from a feature class, you can use the ObjectID of the point. Use FID if the data comes from a shapefile. If the point is in a graphics layer, then define an onClick event handler. You can get a reference to the point graphic via evt.mapPoint.

Hope it helps.
0 Kudos
JacksonGilman1
Occasional Contributor
0 Kudos
Dianede_lanfranchi
Emerging Contributor
It's a graphics layer, i'll give it a try now. thanks alot
0 Kudos