9

I know there are some Android maps libraries that can render vector based tiles from OSM (*.map, etc.). But I did not found any library that only has engine to graphically render vector tiles and returns it as TileProvider to the Google maps api v2 for Android.

For the offline raster tiles: I know how to do for the raster tiles (osmdroid jpg files). Good and working example: TileProvider using local tiles.

Does anybody know where to find this for vector tiles?

Kind regards, Toni

Yakov Galka
  • 70,775
  • 16
  • 139
  • 220
toni
  • 361
  • 7
  • 19
  • Can you be more specific about what format you're interested in? A list of OSM formats is here: http://wiki.openstreetmap.org/wiki/OSM_file_formats – Kevin Krumwiede Dec 03 '14 at 10:57
  • @KevinKrumwiede: I actually do not care which. If I would need to specify, I would use the one that the data can be already found on the web and are sorted by countries, so that I can make updates when more statistics come to specific area. If you done some research, your experience and knowledge would be appreciated. I really like the "Maps with me" functionality, but they have their own format *.mwm. Mapsforge uses *.map format and have download server for the maps sorted by countries (http://download.mapsforge.org/maps/). – toni Dec 03 '14 at 15:33

1 Answers1

0

If you can find a library to render the vector tiles, or enough documentation of the format to write your own renderer, it's pretty easy to turn it into a TileProvider. Tile#data needs to be a compressed image in one of the supported image formats. Once you have a Bitmap, use Bitmap#compress(...) to write the data to a ByteArrayOutputStream, then use ByteArrayOutputStream#toByteArray() to get the data for the Tile.

Kevin Krumwiede
  • 9,868
  • 4
  • 34
  • 82
  • Hi, I know how should TileProvider class be handled, but as you said I need some rendering code for vector tiles. If you or somebody other can give some directions, it would be appreciated! – toni Dec 04 '14 at 09:01
  • @toni I suggest you search for an existing library that can render the vector format you want to use. If you can't find one, or you can't figure out the information you found, then ask a new question specifically about rendering that vector format. This really has nothing to do with Google Maps. – Kevin Krumwiede Dec 12 '14 at 22:06