Home > Software engineering >  Novice, with projects, MFC embedded Google map of offline how by mouse click on the location and the
Novice, with projects, MFC embedded Google map of offline how by mouse click on the location and the

Time:09-16

Does warrior, such as the problem description, now I can already loading on offline maps, but don't know how to directly by the mouse click on the map, and then obtain the latitude and longitude??
Not the WGS coordinates and Google map coordinates??????? If not, how to transform?????? Urgent urgent!!!!!!!!!!!!!!!!!!!!!!!! Thank you very much!

CodePudding user response:

1, map
 
This. _cppObject=window. External
Enclosing _mapOverlay=new Google. Maps. OverlayView ();
Register
. Google maps. Event. AddListener (this, 'mousemove, enclosing OnMapMouseMove);

OffLineMap. Prototype. OnMapMouseMove=function (event) {
Var pointNow=this. _mapOverlay. GetProjection () fromLatLngToContainerPixel (event. LatLng);//get the mouse in the window of the pixel coordinates

If (this. _cppObject) {
Var strLatLng=LatLngArrayToString (event. LatLng);
This. _cppObject. OnMapMouseMove (pointNow. X, pointNow. Y, strLatLng);
}
}

2, MFC end
 
//(ptX, ptY) is the cursor coordinates of the client area of the unit pixel
Void CMapView: : OnMapMouseMove (int ptX, int ptY, cstrings strLatLng)
{
//strLatLng for latitude and longitude string format: latitude and longitude; Latitude and longitude. .
}

CodePudding user response:

Map the var strLatLng=LatLngArrayToString (event. LatLng); Used for converting LatLng type of longitude and latitude "latitude and longitude; Latitude and longitude. . "In the form of a string

CodePudding user response:

Bosses, how to load in the MFC offline maps, can help the younger brother