Get your own customer support community
 

Mouse position to Location translation problem

I'm running into an issue where, when clicking on the map (myMap in the mapView component), I get good mouseX and mouseY values (800x600 grid). When I pass those values to get the lat/lon, I get strange and inconsistent results.

For example, starting around the equator in the Pacific (0,-180), I get a lat,lon of -60, -22.
At the equator and PM (0,0), I get a lat/lon of about -62,158.
Rounding the bend to the Pacific again (0,180), I get a lat/lon of -61,335.

var well:Sprite = Sprite(mapView.myMap.map.grid.getChildByName("well"));
var clickLoc:Location = mapView.myMap.map.pointLocation(new Point(mapView.mouseX, mapView.mouseY), well);

Normally, I'd assumed I'd screwed up the initial settings of the map, but when plotting markers by lat/lon, they are positioned perfectly (a marker in St. Louis ends up in St. Louis, etc.).

------------------

Additional info:

As I scroll in and keep the mouse in the same position (402,223) as (mouseX,mouseY), the lat/lon progress through the zooms as:

2 -63.81145077411647, 155.60263677699368
3 -37.56895063192593, 78.45909284629047
4 -18.762921686386715, 39.88732088093884
5 -8.335640387337225, 20.60143489826303
6 -2.9926624140133717, 10.958491906925131
7 -0.3084336961755266, 6.137020411256181
 
happy I’m confident
Inappropriate?
2 people have this question

User_default_medium