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, 22:37

aseerel4c26's gravatar image

aseerel4c26 ♦
31.6k15234541


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 ♦
36.4k13273581
accept rate: 18%

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 ♦

(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 ♦
31.0k62321714
accept rate: 15%

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×153
×107
×43
×10

question asked: 18 Jan '14, 15:46

question was seen: 9,166 times

last updated: 01 Dec, 22:37

powered by OSQA