osdroid和棉花糖 [英] Osmdroid and marshmallow

查看:131
本文介绍了osdroid和棉花糖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android 6.0中的osmdroid 5.2 lib.我在问WRITE_EXTERNAL_STORAGE and ACCESS_COARSE / FINE_LOCATION permissions on realtime.
但是地图不起作用:

I'm using osmdroid 5.2 lib in android 6.0. I'm asking WRITE_EXTERNAL_STORAGE and ACCESS_COARSE / FINE_LOCATION permissions on realtime.
But map not working:

Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/osmdroid/tiles/Mapnik/14/10079/5358.png.tile: open failed: EACCES (Permission denied)

地图仅在第二个运行的应用程序中有效.
谁能帮我?预先感谢.

Map works only from the second run application.
Can anyone help me? Thanks in advance.

推荐答案

在加载和显示mapview之前,您必须先请求权限.

You have to ask for the permissions before the mapview is loaded and displayed.

要么,要么路径是只读的.在某些android设备上,Environment.getExternalStorageDir返回一个只读分区.不知道为什么,但这肯定会引起问题.可以使用类OpenStreetMapTileProviderConstants

Either that, or the path is read only. On some android devices Environment.getExternalStorageDir returns a read only partition. No clue why, but that will definitely cause issues. It can be overridden with the class OpenStreetMapTileProviderConstants

这篇关于osdroid和棉花糖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆