Select to view content in your preferred language

Custom IdentifyTask on the graphicsLayer

741
3
02-18-2011 05:30 AM
NipaParikh
Deactivated User
I've a flex application which shows ships current cruise. I'm getting the points for each ship from the database and displaying as a polyline graphics layer.

What I would like to do is when user clicks on the polyline, I would like to display the attributes. I'm not sure how to run do a custom identifytask on a graphics layer.

Any help is appreciated.

Thanks.

Nipa Parikh
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Nipa,

   Forget about the identify task as you don't have the need to go to the server and get information from a map service. Just assign a graphic click event to show an info window with your graphics attributes.

This sample uses mouse over but you could easily change it to mouse click by looking at other samples:

http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayer_MouseOver_Snapshot
0 Kudos
NipaParikh
Deactivated User
Robert,

Thanks for the quick reply but in my case I've a graphicslayer and not feature layer.  I'm converting all points into the polyline and adding that as a graphicslayer.

What I want is that when user clicks on the line, I would like to display attributes in an infowindow or a datagrid.

Is there any example out there or what exacly do I change in the sample to do what I want to do.

I hope that make sense.

Nipa
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nipa,

   There is no sample for exactly what you are trying to do. I am getting out of the habit of writing code for people. All the elements that you need to make this work are there in the samples, all you have to do is pick pieces out and try.
0 Kudos