mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

[Feature Request] expose standalone getElevation function

Open LorenzSchueler opened this issue 1 year ago • 1 comments

Currently the elevation of a coordinate can be retrieved using MapboxMap.getElevation. However the caller must make sure that the given coordinate is within the visible region of the map and terrain is enabled.

It would be nice to have a separate function that uses the tile store/ cache to get the DEM tile or requests it if necessary and then extract the elevation from this tile. This way it is no longer necessary to keep an instance of MapboxMap around for which the camera has to be adjusted every time the elevation of a given coordinate is needed.

LorenzSchueler avatar Jul 22 '23 14:07 LorenzSchueler

For a while it was possible to wrap the map that was used for elevation querying in an Offstage Widget to at least avoid rendering the map. However this seems to be no longer possible. If wrapped in Offstage, Visibility(visible: false) or Opacity(opacity: 0) the elevation is always null. The only thing that works is wrapping in SizedBox(height: 1, width: 1) which is far from optimal. This makes it even more desirable to have a standalone function. @evil159 would that be even possible and if so are there plans to add this our could you point out how I could implement it?

LorenzSchueler avatar Feb 14 '24 08:02 LorenzSchueler