0

Hello everyone,

Yesterday, I made my first Android-OpenStreetMap application with Eclipse and the AVD Emulator. I used Osmdroid library and everything worked fine. Map was show. The application was the most simple one, I just made what many tutorials recomend. Very very simple application. And it worked fine.

Everything is OK: manifest, permissions, .java code, libraries, everything.

But today, the exactly same code (I just turned on Eclipse and executed the app) does not work. Map is empty. No maps.

I have installed again eclipse, change debug key, try app on a mobile device, change example, many many things... But it doesn't work. Map is not show. And the code is exactly the same as yesterday.

In logCat I read this:

Problem downloading maptile: /0/0/0 HTTP response: HTTP/1.1 403 Forbidden

Could it be the problem? The app is very very simple and I just proved it for 2 minutes.

I don't know what to do and I have to present the project in 5 days. Please, help.

Thanks very much

asked 18 Jan '14, 15:46

AppNor's gravatar image

AppNor
1111
accept rate: 0%

edited 01 Dec '18, 22:37

aseerel4c26's gravatar image

aseerel4c26 ♦
32.2k16239552


3 Answers:
4

You should check that you are setting your User-Agent to something unique and valid for your application.

Fake (aka trying to impersonate a browser) user agent strings will get your application blocked.

See https://wiki.openstreetmap.org/wiki/Tile_usage_policy

permanent link

answered 18 Jan '14, 16:00

SimonPoole's gravatar image

SimonPoole ♦
40.0k13297634
accept rate: 19%

edited 18 Jan '14, 16:04

Info (in the osmdroid Google group) about setting the user agent properly is here.

(23 Jan '14, 00:22) SomeoneElse ♦
2

(In addition to what Simon Poole says) - you've probably got something like this in your code:

    mapView.setTileSource(TileSourceFactory.MAPNIK);

if you change it to a different tile provider such as:

    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);

it'll work. You must, of course, adhere to the terms of use of whatever tiles you are using, which in the case of these Mapquest open tiles seems to be here.

The source, FWIW, seems to be here.

I guess that you could also overload TileSourceFactory and define a source of other tiles too, such as some you've created yourself via something like switch2osm.

permanent link

answered 18 Jan '14, 18:43

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

2

Thanks a lot. It worked. Other person told me that MAPNIK was not working and that was the problem. So, as you said, I changed to MAPQUESTOSM and it worked. About the terms, my aplication was very very simple, the typical first steps application, so I think that the reason of not working was MAPNIK and their servers or something like that.

Thanks again!

(19 Jan '14, 12:40) AppNor

Whilst MAPQUESTOSM worked in 2014 it won't now, since Mapquest tiles are no longer produced. Creating your own tiles and getting OsmDroid to use this will still work, of course.

(20 Mar '19, 12:14) SomeoneElse ♦
1

Even I faced this issue after some googling I came across a solution, we need to set User agent value in configuration. Please refer to this link for furthermore clarification https://github.com/osmdroid/osmdroid/wiki/Important-notes-on-using-osmdroid-in-your-app

permanent link

answered 20 Mar '19, 11:54

SyedSaqibRuman's gravatar image

SyedSaqibRuman
3012
accept rate: 0%

1

See this question for why this has become a particular issue now. The answer remains the same though.

(20 Mar '19, 12:16) SomeoneElse ♦

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×167
×110
×50
×11

question asked: 18 Jan '14, 15:46

question was seen: 11,291 times

last updated: 20 Mar '19, 12:16

powered by OSQA