Skip to main content

flywave-mapview.mapview.getgeocoordinatesat_1

Home > @flywave/flywave-mapview > MapView > getGeoCoordinatesAt

MapView.getGeoCoordinatesAt() method

Returns the from the given screen position.

Signature:

getGeoCoordinatesAt(x: number, y: number, fallback?: boolean): GeoCoordinates | null;

Parameters

Parameter

Type

Description

x

number

The X position in css/client coordinates (without applied display ratio).

y

number

The Y position in css/client coordinates (without applied display ratio).

fallback

boolean

(Optional) Whether to compute a fallback position if the earth surface is not hit.

Returns:



GeoCoordinates \| null

Un-normalized geo coordinates

## Remarks

If `fallback !== true` the return value can be `null`<!-- -->, in case the camera has a high tilt and the given `(x, y)` value is not intersecting the ground plane. If `fallback === true` the return value will always exist but it might not be on the earth surface. If [MapView.tileWrappingEnabled](./flywave-mapview.mapview.tilewrappingenabled.md) is `true` the returned geo coordinates will have a longitude clamped to \[-180,180\] degrees. The returned geo coordinates are not normalized so that a map object placed at that position will be below the (x,y) screen coordinates, regardless which world repetition was on screen.