Osmdroid and Mapnik tile provider no longer works

I have a deployed, deployed, and previously successful application that uses Osmdroid to download fragments from the default tile provider, which is Mapnik

mMapView.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE); 

or

 mMapView.setTileSource(TileSourceFactory.MAPNIK); 

Until recently (possibly from today) tiles on real devices (phone and tablet) are no longer loaded. I am using osmdroid version 3.0.5. If I try the latest version 4.0 in a small sample project on the emulator, I see โ€œ403 forbidden answersโ€ โ€‹โ€‹in logcat when I try to load maptiles. If I switch the tile source to

 mMapView.setTileSource(TileSourceFactory.MAPQUESTOSM); 

then the display is visible without problems. I donโ€™t see any messages about the list of releases of Osmdroid websites , and a Google search did not reveal any new problems, so I ask if anyone else sees this new behavior from Mapnik and can know about the fix?

+6
source share
4 answers

Follow Issue 515 to track this issue. We have implemented the fix, and will soon publish the corresponding update.

+4
source

Having the same problem.

Unfortunately, it seems that osmdroid has been denied access to http://tile.openstreetmap.org . While reading the tile usage policy , I found these two things that could explain why osmdroid was banned:

Heavy use (for example, distributing an application using fragments from openstreetmap.org) is prohibited without prior permission from system administrators.

and

Valid agent user id. Fake another application. The user agent will block you.

(oasmdroid useragent - "Apache-HttpClient / UNAVAILABLE (java 1.4)", which is pretty general)

+4
source

From OpenPisteMap:

If you start getting 403 Forbidden answers, stop. Do not just stay away from the server - this probably means that you were forbidden for abusive behavior and the server continues to simply expand your ban.

http://wiki.osm.org/wiki/Blocked

+1
source

This code can be used to install the user agent.

  HttpClientFactory.setFactoryInstance(new IHttpClientFactory() { public HttpClient createHttpClient() { final DefaultHttpClient client = new DefaultHttpClient(); client.getParams().setParameter(CoreProtocolPNames.USER_AGENT, "useragent"); return client; } }); 
0
source

All Articles