I am using the following to calculate and display the cursor location:
latlong = map.PixelToLatLong(event.clientX, event.clientY);
Then, in the map.OnClick event, I use e.view.LatLong to display the cursor location. However, the two values are different!
Which one is right Since I'm adding data to a database based upon the location I feel it's important to get it right!

LatLong calculated with PixelToLatLong varies from e.view.LatLong
Thibaud
John.
var mapleft = 0;
var maptop = 0;
function SetMapOffsets(obj) {
if (obj.offsetParent) {
mapleft = obj.offsetLeft
maptop = obj.offsetTop
while (obj = obj.offsetParent) {
mapleft += obj.offsetLeft
maptop += obj.offsetTop
}
}
}
//usage
function GetMap()
{
map = new VEMap('MapDiv');
map.LoadMap(new VELatLong(-27, 152), 5 ,'r' ,false);
SetMapOffsets(document.getElementById("MapDiv"));
}
rwerner
Thanks John!
Just to wrap this up, I now use the following to get my LatLong (based upon John's code above):
latlong = map.PixelToLatLong(
event.clientX - mapleft, event.clientY - maptop)