Get the nearest markers

Topics: Windows Mobile
Dec 5, 2011 at 1:48 PM

I am trying to get the GMap.Net working for my Windows mobile (6.1 and 6.5). How to get the list of markers nearest to the position where an user clicked? And also can I try to open a context menu on clicking a marker.

Coordinator
Dec 5, 2011 at 2:03 PM

var objectsInArea = from p in objects
where MainMap.MapProvider.Projection.GetDistance(center, p.Point) <= areaRadius
select new
{
   Obj = p,
   Dist = MainMap.MapProvider.Projection.GetDistance(center, p.Point)
};

if(objectsInArea.Any())
{
 ... 

..and for context menu, use OnMouseOver event 

Dec 5, 2011 at 2:21 PM

Thank you for the instant reply. Before that what even handler method should I use to get the click event and get the lat long where the user clicked. I tried map.Click. But I couldnt get the lat and long from the event args.

Coordinator
Dec 5, 2011 at 2:23 PM

..well just check demo source, all basic functionality are used

Dec 5, 2011 at 2:40 PM

I tried to use OnMarkerClick event method in Windows Mobile project, but that method is not available for a smart device project. It is available only for Windows version. Is there any other alternate method for Windows mobile?

Coordinator
Dec 5, 2011 at 4:24 PM

"..and for context menu, use OnMouseOver event "

Dec 5, 2011 at 4:31 PM

I just checked again, OnMouseOver and OnMarkerClick events are not available in "GMap.NET.WindowsMobile" dll. I think for mobile project, the dll I should refer is GMap.NET.WindowsMobile. Let me know can I reference "GMap.NET.WindowsForms.dll" in a smart device project.

Coordinator
Dec 5, 2011 at 5:01 PM

OnMouseOver is avaible, in the last changeset it should work again