1

I wish to get the altitude of a given visible point on the map. If I setup terrain like so:

var source = RasterDemSource()
source.url = "mapbox://mapbox.mapbox-terrain-dem-v1"
try! style.addSource(source, id: "sourceId")

let terrain = Terrain(sourceId: "sourceId")
try mapView.mapboxMap.style.setTerrain(terrain)

I am able to get the altitude from the Raster DEM Tile by querying:

mapView.mapboxMap.elevation(at: position)

However, this only works if the terrain is set (which renders the map with terrain in 3D). Is there any way to query this information directly without displaying 3D terrain?

I wish to not rely on Tilequery API as I require offline support whilst allowing checking of elevation data over a large area.

David
  • 732
  • 1
  • 6
  • 15
  • Hey @David, separate ask, but is seems from the above you are one step ahead, any idea about this? https://stackoverflow.com/questions/76685348/why-is-mapboxmap-elevationat-returning-nil – Gustavo Jul 15 '23 at 04:21

0 Answers0