Blurry map tiles at start of android app based on google Maps API v2

ε祈祈猫儿з 提交于 2019-12-05 04:36:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!