Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Osmdroid and Mapnik tile provider no longer working

I have a developed, deployed and previously successful application which uses Osmdroid to load tiles from the default tile provider which is Mapnik

mMapView.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);

or

mMapView.setTileSource(TileSourceFactory.MAPNIK);

Until recently (maybe since today) the tiles on real devices (a phone and a tablet) do not load anymore. I am using osmdroid version 3.0.5. If I try the latest 4.0 version in a small sample project on an emulator, I see '403 forbidden responses' in the logcat when trying to download maptiles. If I switch the tile source to

mMapView.setTileSource(TileSourceFactory.MAPQUESTOSM);

then the map is visible with no problem. I don't see any reported issues on the Osmdroid web site issues list, nor does a Google search reveal any new problems reported, so I am asking if anyone else sees this new behaviour from Mapnik and might know of a fix?

like image 525
NickT Avatar asked Jan 17 '14 17:01

NickT


3 Answers

Please follow Issue 515 to track this issue. We have implemented a fix and we will release a proper update soon.

like image 59
kurtzmarc Avatar answered Sep 18 '22 16:09

kurtzmarc


Having the same problem as well.

Unfortunately, it seems that osmdroid was banned from accessing http://tile.openstreetmap.org. Reading the tile usage policy, I found these two things which might explain why osmdroid got banned:

Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators.

and

Valid User-Agent identifying application. Faking another app's User-Agent WILL get you blocked.

(osmdroid's useragent is "Apache-HttpClient/UNAVAILABLE (java 1.4)" which is pretty generic)

like image 41
user3210008 Avatar answered Sep 19 '22 16:09

user3210008


From OpenPisteMap:

If you start getting "403 Forbidden" responses, stop. Don't just keep hammering away at the server - it probably means that you've been banned for abusive behaviour and continuing to hammer away at the server will just extend your ban.

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

like image 42
Torsten Römer Avatar answered Sep 18 '22 16:09

Torsten Römer