4

I have an Android + iOS app using Google Maps SDKs to display a map, and I'm in the process of setting up an OSM tile server.

I'm evaluating the possibility to use vector tiles instead of raster, but replacing Google Maps SDK isn't an option.

So, I'd like to know if it's possible to render a vector tile on Android & iOS to an image? Would Mapbox GL native C++ SDK allow me to do that with .mvt tiles? If not, is there another option?

3

For Android, we looked into this a few years ago (circa 2014):

https://github.com/CUTR-at-USF/OpenTripPlanner-for-Android/issues/356

We ended up just using raster tiles, but we were looking at the below tools to potentially do vector rendering at that time:

From some quick Googling, I found the below library too (and there are likely more):

Note that Mapzen shut down at the beginning of this year, but according to:

https://mapzen.com/blog/migration/

...they recommend the following for vector tiles and basemaps:

For basemaps and vector tiles, you may want to consider:

Long-term support for Vector Tiles is available via Nextzen through 2018 supported by Amazon Web Services, thanks to an award from the Earth on AWS Cloud Credits for Research Program. This includes hosted versions of Tangram JS and the map styles. The vector tile data is an archived December 2017 global build available in a requestor pays S3 bucket with associated serverless software.

Terrain Tiles will continue to be available as an Amazon Public Dataset.

Mapzen Vector Tiles and Cartography are based on the Tangram and Tilezen open-source projects. Read below for information on how to run these services locally.

Tangram scene files saved in a Tangram Play account can be saved to a GitHub Gist or downloaded locally, while Mapzen services are still running.

  • Thanks for this answer! For now I'd first like to check if it's possible to render a vector tile on Android / iOS (.mvt or .pbf -> .png). If that's possible I'll see the solutions for serving the tiles, but I think that serving tiles will be the "easy" part, compared to render them on mobile... Have you had a chance to play with native MapBox GL ? – Tim Autin Jul 3 '18 at 12:15
  • No, I haven't had a chance yet. My understanding though is that the libraries I linked to can render raster tiles. Let me know if you find differently. – Sean Barbeau Jul 6 '18 at 2:08
  • 1
    Yep you're right, I managed to render raster tiles form a .mvt source with MapBox SDK, see my answer. – Tim Autin Jul 6 '18 at 17:26
2

So I've been able to render tiles from a .mvt source, using MapBox's SDK's MapSnapshotter.

These tiles can then be displayed on the Google Maps SDK (using a custom TileProvider). It's working well: a little bit slower than most raster tiles, but still usable.

On the downside, the MapSnapshotter automatically adds the map attribution label on each snapshot it creates, and thus on each tile, which is not the desired behaviour (the attribution already being displayed in a corner of the screen). The good news is that MapBox SDK is open, so that can be modified.

0

We use WhirlyGlobe for Android and IOS it natively renders vector tiles both from server and inside mbtiles. It's super fast and efficient supports styling via SLD,Mapbox GL JSON and inline. It also supports shapefiles, GeoJSON,drawing from sqlite. http://mousebird.github.io/WhirlyGlobe/

  • I saw that quickly. Do you know if it support 3D terrain? Anyway, I'm trying to learn OpenGL ES, having my own SDK would make me 100% free. But what a huge amount of work ^^ – Tim Autin Jul 7 '18 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.