User-Agent for osmdroid

2019-03-01 13:42发布

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.

Thanks you very much in advance !

1条回答
孤傲高冷的网名
2楼-- · 2019-03-01 13:57

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.

查看更多
登录 后发表回答