国内谷歌定位偏移怎么办?地图的偏移纠正过来了,但是定位点还是在那,没动,怎么修正定位的偏移呢?定位的源码
private void setupMap() {
// Do a null check to confirm that we have not already instantiated the map.
if (mGoogleMap == null) {
// Try to obtain the map from the SupportMapFragment.
((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
mGoogleMap = googleMap;
mGoogleMap.setIndoorEnabled(true);
if (ContextCompat.checkSelfPermission(MapAct.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(MapAct.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_ID);
return;
}
mGoogleMap.setMyLocationEnabled(true);
mGoogleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {
@Override
public void onMyLocationChange(Location location) {
speed = (int) ((location.getSpeed() * 3600) / 1000);
Log.e("mahi ", "speed" + speed);
// TranslateGps.gcj_To_Gps84(location.getLatitude(),location.getLongitude())
mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng( TranslateGps.gps84_To_Gcj02(location.getLatitude(),location.getLongitude()).getWgLat(),
TranslateGps.gps84_To_Gcj02(location.getLatitude(),location.getLongitude()).getWgLon()), 15));
LatLng latlng = new LatLng(location.getLatitude(), location.getLongitude());
// AMapUtil.transformFromGCJToWGS(latlng);
if (status) {
points.add(latlng);
// redrawLine();
}
System.out.println("mahi onLocation Changed Call");
}
});
}
});
// Check if we were successful in obtaining the map.
if (mGoogleMap != null) {
}
}
}