Android mapview partially loading tiles

有些话、适合烂在心里 提交于 2019-12-06 16:31:34

I can guess that you can see partial tiles so may be your internet connection problem. Check your Internet connection weather it displays 3G icon in emulator if you are trying to run your app in emulator else check in device.

I had found same problem as you because when I had connection some part of map displayed and after some time i had opened it again and at that time i had not internet so I had found partial tiles on map which was loaded at the first time.I had connect to internet and try again then my issue is solved map displays fine.

Suggestion

public class yourCustomMapView extends MapView{
    public abstract void invalidateDrawable (Drawable who){
        super.invalidateDrawable(who);
        //try to catch the error here:
        //My Guess is the following:
        if(who.getTransparentRegion!=null){
            //DO SOMETHING
            //You would delete the cache and reload
            //Try Reloading the image only
        }
    }
}

Deleting the cache programmatically

This is the easier part. You will have manually to delete all the databases and files associated with your application. Do not forget to close databases and streams to files before deleting. This is if it turns out that you have to clear the cache.

It can happen if the network connection is not proper. I mean if there is any problem from network provider side. It happend for me too. Just run the app after some time. I hope it may solve problem.

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