How to add a pushpin to the map? (problem getting LatLong-values)

Mar 2, 2009 at 11:58 PM
I've been trying out things with VIEWS and one problem is bothering me. How can I add a pin on to the map to the exact spot where my cursor 
is pointing? VEMapEventArgs is not giving me LatLong values which I would need. It's failing to give me it, VEMapEventArgs.LatLong.Latitude
is not returning anything. I debugged it and the result is a null reference.
Do you have any idea how to get that info needed to creating a pushpin to the cursor spot in the map? Thank you for any help.
Mar 5, 2009 at 2:40 AM
The LatLong isn't always supplied. This is the case in JavaScript as well. The trick is to use the pixel coordinates to get a LatLong:



void map_MouseUp(object sender, VEMapEventArgs e)




// Get a VE LatLong from the map coordinates



VELatLong latLong = map.PixelToLatLong(new VEPixel(e.MapX, e.MapY));



// Do something with the LatLong