osmdroid 的用户代理 [英] User-Agent for osmdroid

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

问题描述

我尝试放置用户代理(参见 https://github.com/osmdroid/osmdroid/wiki/Important-notes-on-using-osmdroid-in-your-app),但是当我把行 OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID); Android studio 告诉我 setUserAgentValue 已折旧.

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屋!

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