Search code examples
androidgoogle-mapsopenstreetmap

Graphic below specific area in some Android Map API


I'm looking form maps API that would allow me to put pattern in some form (maybe graphic) below forest area, to have something like this (image below) and not only plain colour. Later on I would need to put such images on different areas and roads, also ability to put some 3D building on map would be great.

I found only ways of adding 3D objects and chagning area colours. Maybe I'm using bad words but only results on stackverflow and google were for custom background in markes.

Can you recommend some map API? (If you have some open-source project where I can see how its done it would be awesome. Thank you for your help.

Maps with graphic below forest


Solution

  • Alternative solution I decided to use is to render vector tiles on your own. There are two good services to obtain tiles:

    1. Mapbox tiles in MVT format - any zoom, to get tile just use link https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7/{z}/{x}/{y}.mvt?access_token={access_token}

    2. MapTiler Tilehosting tiles in PBF format - zoom max 14, PBF format is basically same as Mapbox MVT (same parsers might be used), to get tile just use link https://free.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?key={access_token}

    When decoding thies some Polygons might not parse properly, here is answer for that question: Mapbox vector tile MVT is missing data

    Rendered tiles can be used with google API by TileOverlay, this gives all Google API features and it is easy to use (mMap.setMapType(GoogleMap.MAP_TYPE_NONE); to disable all google map labels). Downside is of course tile rendering that needs to be done on your won, but for me this is positive, because I have full control on what is displayed (I use OpenGL ES, I recommend EGL14, off-screen rendering here).