问题
I have an app including a Google Map APIv2.
After starting the app the map tiles are blurry. (sometimes just some parts)
The tiles are getting sharp, only when the user moves the mapview a little.
Moving the mapview by code does not solve the problem.
Any ideas?
回答1:
I has similar issue where the map would render blurry/low fidelity until I dragged the map with finger.
The issue I think was because I was updating the map with googleMap.animateCamera(cameraUpdate);
once every second but I wasn't taking into account previous calls to animateCamera
and whether the map was still animating.
The fix was to let use GoogleMap.CancelableCallback
to find out when the animation had finished before calling animateCamera()
again.
GoogleMap.CancelableCallback cancelableCallback = new GoogleMap.CancelableCallback() {
@Override
public void onFinish() {
animationInProgress = false;
}
@Override
public void onCancel() {
animationInProgress = false;
}
};
if(!animationInProgress){
animationInProgress = true;
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), cancelableCallback);
}
回答2:
if your network connectivity is fine, then this issue should be due to caching of bad map data. You can clear the cache in google play service by going to Settings>Application>Google Play Service>Clear Cache and then try again.
来源:https://stackoverflow.com/questions/18173912/blurry-map-tiles-at-start-of-android-app-based-on-google-maps-api-v2