NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I would like to display 20 polygons on top of Openstreetmap data in my Android app, does anyone have working code for doing such a thing?

asked 16 Oct '12, 07:37

emj's gravatar image

accept rate: 15%


There are lots of resources available, but I really just want a good hands on tip with code, not a link like has been given before: and

(16 Oct '12, 07:39) emj

A bit more information about what else you wanted the Android application to do might be helpful.

For example, this switch2osm Leaflet example might work pretty much out of the box under Phonegap on Android (it certainly does on Blackberry), and Leaflet supports drawing Polygons.

I don't have a "here is one that I made earlier" example, though, and depending on what else you want to do this may be a terrible place to start from.

(16 Oct '12, 17:37) SomeoneElse ♦

You first need to decide whether you want to draw polygons over an existing pre-rendered map (i.e. Mapnik tiles) or if you would like to render everything yourself.

permanent link

answered 16 Oct '12, 16:19

gormo's gravatar image

accept rate: 13%

Not really, rendering it all by myself is not something I would ask for here. Sure vector graphics vs. bitmaps is always an interesting thing to ask yourself, but I don't really care, what ever exists and works is good. I'm guessing very few people actually use OSM in Android apps.

(16 Oct '12, 17:05) emj

I would probably look into OSMdroid and a PathOverlay. Java source (and thus, API documentation) is at .

(16 Oct '12, 18:04) gormo

You could read this great and very well-written tutorial.
It contains clear explanations, step by step, and some simple working code.
Following articles also talk about overlays, very useful in order to draw over the map.

permanent link

answered 19 Aug '14, 21:40

Graziano%20Capelli's gravatar image

Graziano Cap...
accept rate: 0%

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 16 Oct '12, 07:37

question was seen: 30,403 times

last updated: 19 Aug '14, 21:40

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum