newbie: buffer/tolerance around click point

711
6
10-05-2010 04:31 AM
AntonHughes
New Contributor
Hi

its my first time using the ESRI silverlight control, so I'm not sure of the best way to achieve this...

I have loaded in some map data from a JSON feed. This is then used to display points on the map.

when the user clicks on one of those points I need a dialog box to open.

I am unsure of how - and what classes to use - to create a rectangle or area around the clicked pixel, and then iterate through the collection (from JSON) to see if the clicked area contains an item from the JSON collection.

Is there an example of this, or can someone help me out?

Regards,
0 Kudos
6 Replies
DominiqueBroux
Esri Frequent Contributor
Did you look at this sample ? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GeoRSS

The data are coming from an XML feed instead a JSON feed but it looks close of what you need.
0 Kudos
AntonHughes
New Contributor
Did you look at this sample ? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GeoRSS

The data are coming from an XML feed instead a JSON feed but it looks close of what you need.


Thanks for the reply, however this did not help.

I already have the data loaded, and icons displayed on the map.

I found a solution to my problem, though I don't know if it is the best way to do it.

Instead of using icons, I use buttons. And I attach data to the DataContext of each button. Therefore I do not need to have a pixel tolerance, or similar function.
0 Kudos
JenniferNery
Esri Regular Contributor
You can subscribe to the MouseLeftButtonDown event on the GraphicsLayer that contains the graphics with point geometry. The GraphicEventArgs contain e.Graphic so you will know exactly which Graphic had been clicked.
0 Kudos
KevinSesock
New Contributor
Would this be possible on an ArcGISDynamicServiceLayer for an Identify Task? I'm just asking because our Map_MouseClick event makes the user click on the exact pixel to get a Identify completed on a Point feature, and it makes it difficult for the end user to select an item.
0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos
KevinSesock
New Contributor
The tolerance property of the IdentifyParameters class is how to handle this. Thanks for the help.
0 Kudos