transformWgsToScreen method
- Coordinates coords
Converts WGS84 geographic coordinates to screen coordinates.
Transforms a geographic location (latitude, longitude, altitude) to its corresponding screen position in physical pixels. The screen position is measured from the map view's top-left corner.
This transformation depends on the current camera state, including position, zoom level, map angle, and view angle. The same geographic coordinates will project to different screen positions as the camera moves or rotates.
Parameters
coords: WGS84 geographic coordinates to convert
Returns
- Screen position in physical pixels, relative to the map view's top-left corner
See also:
- transformScreenToWgs - Convert screen coordinates to geographic coordinates
- transformWgsListToScreen - Convert multiple coordinates at once
- transformScreenToWgsRect - Convert screen rectangle to geographic area
Implementation
Point<int> transformWgsToScreen(final Coordinates coords) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'transformWgsToScreen',
args: coords,
);
return XyType<int>.fromJson(resultString['result']).toPoint();
}