Get geolocation

The behaviour type Get geolocation requests current location (geoposition) information from the client device.

Whether and, if so, on the basis of what methods and with what characteristics (geographical coordinates, speed, altitude) the client device provides such information depends on the individual hardware configuration and data protection settings in the operating system.

Furthermore, 'location access' via the browser must be explicitly permitted by the user. Unless there is an appropriate exception in the context of a specific web page, each request requires a case-by-case decision.

NOTE◄ While acceptance is only valid for each individual request, any rejection is 'remembered' for future attempts within the same session, so that there is no further request until the next Lobster Data Platform / Orchestration login.

If the behaviour type allows location access at runtime, the Actions on 'true' are executed with a client object as $input that uses the following fields:

Field name

Type

Content

accuracy

number

Measurement accuracy for latitude and longitude in meters (m).

altitudeAccuracy

number

Measurement accuracy of the altitude in meters (m).

heading

number

Direction ('compass bearing' or viewing direction) in degrees with positive values increasing clockwise from 0° (north) to 359°.

latitude

number

Latitude in degrees relative to the equator at 0° with values between -90° (South Pole) and 90° (North Pole).

longitude

number

Longitude in degrees relative to the prime meridian ('Greenwich') at 0° with 'west longitude' at -180° and 'east longitude' at +180.

altitude

number

Altitude above sea level in metres (m).

speed

number

Currently calculated speed in meters per second (m/s).

timestamp

number

Time stamp of measurement in milliseconds since 01.01.1970 00:00 (UTC).

If location access is not possible or not allowed at runtime, a text value with an error message is passed as $input to the Actions on 'false'.

Runtime example:

Output of available location data in the browser console using the action Log to console:

images/download/attachments/78254139/image2020-5-22_10-43-49-version-1-modificationdate-1627988810023-api-v2.png

  • Since the accuracy (>100km) is very low and no information about movement (altitude, direction, speed) is returned, this information was apparently not 'measured' by GPS but indirectly determined from connection data.

If the user refuses location access in the same situation, the return value is, for example:

images/download/attachments/78254139/image2020-5-22_10-50-14-version-1-modificationdate-1627988810028-api-v2.png

  • This error message can, for example, be made visible to the user via a Show alert (via $input).