transformScreenToWgs method
Convert a screen(x, y) coordinate to a WGS(lon, lat) coordinate.
Parameters
- IN screenCoordinates Screen coordinate. The coordinates are relative to the parent view screen
Returns
- WGS 84 coordinates of the given screen coordinate
Throws
- An exception if it fails.
Implementation
Coordinates transformScreenToWgs(final Point<int> screenCoordinates) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'transformScreenToWgs',
args: XyType<int>.fromPoint(screenCoordinates),
);
final Coordinates coords = Coordinates.fromJson(resultString['result']);
if (coords.altitude != null &&
coords.altitude! > -0.0001 &&
coords.altitude! < 0.0001) {
coords.altitude = 0;
}
return coords;
}