Skip to content
English
  • There are no suggestions because the search field is empty.

Wayfinder Location Class

This class is used to manage the map API's interaction with the browser's Geolocation API. It also manages the 'You Are Here' maker.

Generally you do not need to use this class directly, and so this information is provided mainly just for reference.

 

This class has the following properties and functions:

showCurrentLocation

property (r/w)

boolean to indicate whether the 'You Are Here' marker is enabled. Can be set to enable the feature. An error will be thrown if the feature cannot be enabled.

withinBounds

property (r)

boolean to indicate whether the user is within the map bounds. An error will be thrown if showCurrentLocation is not enabled.

currentMapCoordinates

property (r)

Get the current map coordinated based on the last known GPS position. Returns a Vector2 representing the point on the map or null if there is no last known position.

gpsPointInBounds(point)

function

boolean indicating whether the given coordinates are within the map bounds. An error will be thrown if the point is not an instance of GeolocationCoordinates.

mapPointInBounds(point)

function

boolean indicating whether the given map point is within the map bounds.

gpsToMap(coords)

function

Convert GeolocationCoordinates to a point on the map. Returns a Vector2 representing the point on the map or null if the coordinates are out of the map bounds .

updateMapMaker()

function

Update the visibility and position of the 'You Are Here' marker.