mapbox-maps-flutter
mapbox-maps-flutter copied to clipboard
[Feature Request] expose standalone getElevation function
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.
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?