osmdroid的用户代理 [英] User-Agent for osmdroid
问题描述
I tried to put the user agent (cf https://github.com/osmdroid/osmdroid/wiki/Important-notes-on-using-osmdroid-in-your-app), but when I put the line OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID);
Android studio is telling me that setUserAgentValue is depreciated.
该如何解决?现在,当我运行该应用程序时,我有一个没有地图的网格.
What can I do to solve that ? For now when I run the app I have a grid with no map.
非常感谢您!
推荐答案
已弃用,因为已将其移至合并了osmdroid的所有配置设置的其他位置.尝试以下
It's deprecated because it's been moved to another location which consolidates all configuration settings for osmdroid. Try the following
Configuration.getInstance().setUserAgentValue(...)
将旧方法重写为将其连接到新的配置结构中.
The older method was rewritten to wire it into the new configuration construct.
这篇关于osmdroid的用户代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!