【问题标题】:User-Agent for osmdroidosmdroid 的用户代理
【发布时间】:2017-08-26 09:28:09
【问题描述】:

我尝试放置用户代理 (cf https://github.com/osmdroid/osmdroid/wiki/Important-notes-on-using-osmdroid-in-your-app),但当我放置 OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID); 行时,Android Studio 告诉我 setUserAgentValue 已贬值。

我能做些什么来解决这个问题?现在,当我运行应用程序时,我有一个没有地图的网格。

非常感谢您!

【问题讨论】:

  • 不推荐使用的方法并不表示它不起作用。这只是意味着该方法可能会在库的未来版本中消失。 FAQ的第一个问题有帮助吗? github.com/osmdroid/osmdroid/wiki/FAQ

标签: android linux android-studio openstreetmap osmdroid


【解决方案1】:

它已被弃用,因为它已被移动到另一个位置,该位置整合了 osmdroid 的所有配置设置。试试下面的

Configuration.getInstance().setUserAgentValue(...)

旧方法被重写以将其连接到新的配置结构中。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-23
  • 1970-01-01
  • 2012-09-25
  • 1970-01-01
  • 2014-03-23
  • 2021-08-06
相关资源
最近更新 更多