Blurry map tiles at start of android app based on

2019-04-12 00:44发布

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?

2条回答
▲ chillily
2楼-- · 2019-04-12 01:04

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);
        }
查看更多
虎瘦雄心在
3楼-- · 2019-04-12 01:08

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.

查看更多
登录 后发表回答