15,980
社区成员




this._cppObject = window.external
this._mapOverlay = new google.maps.OverlayView();
注册
google.maps.event.addListener(this, 'mousemove', this.OnMapMouseMove);
OffLineMap.prototype.OnMapMouseMove = function (event) {
var pointNow = this._mapOverlay.getProjection().fromLatLngToContainerPixel(event.latLng); //获取鼠标在窗口的像素坐标
if (this._cppObject) {
var strLatLng = LatLngArrayToString(event.latLng);
this._cppObject.OnMapMouseMove(pointNow.x, pointNow.y, strLatLng);
}
}
2、MFC端
//(ptX,ptY)是光标的客户区坐标,单位像素
void CMapView::OnMapMouseMove(int ptX, int ptY, CString strLatLng)
{
//strLatLng为经纬度字符串,格式:纬度,经度;纬度,经度;.........
}