getAltitude method
- Coordinates coordinates
Retrieves the altitude at specified geographic coordinates.
Returns the terrain elevation at the given coordinates when the applied map style includes elevation data and terrain topography is loaded. Use hasTerrainTopography to check if altitude retrieval is available.
If terrain topography is not available, returns 0.
Parameters
coordinates: The WGS84 geographic coordinates to query for altitude
Returns
- Altitude in meters above sea level if terrain data is available, otherwise
0
See also:
- hasTerrainTopography - Check if terrain elevation data is available
- transformScreenToWgs - Get coordinates with altitude from screen position
Implementation
double getAltitude(Coordinates coordinates) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'getAltitude',
args: coordinates,
);
return resultString['result'];
}