flutter-maplibre-gl icon indicating copy to clipboard operation
flutter-maplibre-gl copied to clipboard

Support 3D terrain?

Open Artem-S1 opened this issue 1 year ago • 2 comments

Does this plugin supports 3D already? Example from JS version of library: https://docs.mapbox.com/mapbox-gl-js/example/add-terrain/

Artem-S1 avatar Jun 28 '23 13:06 Artem-S1

You are linking to Mapbox docs, but this is a MapLibre plugin. (Though it is forked from a Mapbox plugin.) So if you are looking for Mapbox specific features, you should look at Mapbox plugins.

AFAIK MapLibre recently added support for 3d terrain, but there have not been any explicit changes for that in this plugin, yet.

m0nac0 avatar Jun 30 '23 10:06 m0nac0

I just tested, it works on web but not on mobile (hillside is working on mobile though). You can use this demo style to try:

{
  "version": 8,
  "sources": {
    "raster-tiles": {
      "type": "raster",
      "tiles": [
        "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
      ],
      "tileSize": 256,
      "attribution": "<a target='_top' rel='noopener' href='http://openstreetmap.org'>© OpenStreetMap</a>"
    },
    "terrainSource": {
      "type": "raster-dem",
      "url": "https://demotiles.maplibre.org/terrain-tiles/tiles.json",
      "tileSize": 256
    },
    "hillshadeSource": {
      "type": "raster-dem",
      "url": "https://demotiles.maplibre.org/terrain-tiles/tiles.json",
      "tileSize": 256
    }
  },
  "layers": [
    {
      "id": "simple-tiles",
      "type": "raster",
      "source": "raster-tiles",
      "minzoom": 0,
      "maxzoom": 22
    },
    {
      "id": "hills",
      "type": "hillshade",
      "source": "hillshadeSource",
      "layout": { "visibility": "visible" },
      "paint": { "hillshade-shadow-color": "#473B24" }
    }
  ],
  "terrain": {
    "source": "terrainSource",
    "exaggeration": 1
  },
  "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
}

timautin avatar Aug 18 '23 16:08 timautin