mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.36k stars 1.33k forks source link

"maxzoom" for "raster-dem" source does not work with the Terrain RGB #16461

Open ystsoi opened 4 years ago

ystsoi commented 4 years ago

As mentioned in https://github.com/mapbox/mapbox-gl-native/issues/16459, "maxzoom" for "raster-dem" source does not work with the Terrain RGB set via "url", "maxzoom" only works with custom tiles set via "tiles".

For example, "maxzoom" does not have any effect in the following source:

    "mapbox://mapbox.terrain-rgb": {
      "url": "mapbox://mapbox.terrain-rgb",
      "type": "raster-dem",
      "maxzoom": 11,
      "tileSize": 256
    }

But, "maxzoom" works for a custom source, like:

    "terrain": {
      "tiles": ["asset://terrain/{z}/{x}/{y}.png"],
      "type": "raster-dem",
      "maxzoom": 11,
      "tileSize": 256
    }

As we may not need to use high zoom level data for simple hillshade, it should be good to be able to limit the maxzoom for efficiency purpose.