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 |
You could read this great and very well-written tutorial. answered 19 Aug '14, 21:40 Graziano Cap... |
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. answered 16 Oct '12, 16:19 gormo 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
1
I would probably look into OSMdroid and a PathOverlay. Java source (and thus, API documentation) is at http://code.google.com/p/osmdroid/source/browse/trunk/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java .
(16 Oct '12, 18:04)
gormo
|
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: http://wiki.openstreetmap.org/wiki/Android http://wiki.openstreetmap.org/wiki/Mapsforge and http://wiki.openstreetmap.org/wiki/Osmdroid
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.