Get Current Position Activity


Obtains the client's current physical location using the geolocation features of the client application.

Inheritance Hierarchy:



This activity allows you to find the geographic coordinates of the user running the application.

This activity relies on the geolocation support of the host web browser. Typically the user is prompted by the browser to give their permission to share their location information. If the user does not grant permission, the activity completes with a Permission Denied error code.

This activity always reports positions using the WGS84 (4326) spatial reference. This may not match the spatial reference of your application.

This activity is currently supported by Essentials JavaScript API version 2.3.

In a Workflow:

You would use this activity to obtain the user's current position, which can then be passed to another activity. You could then zoom the map to the user's location, or perform a reverse geocode.


Name Description

In Arguments

Accuracy Threshold

An optional input of Type Int32. The default is 10. The device-reported accuracy in meters that must be reached before a reading is considered valid. This value is only used when Use Multiple Readings is activated.

Enable High Accuracy

Provides a hint that the application would like to receive the best possible results.

Maximum Age

The maximum age of a cached position that the application is prepared to accept. Measured in milliseconds. If not specified, the application obtains a fresh location.


The amount of time that the client waits for a location - in milliseconds. If not specified, the application waits indefinitely.

When Use Multiple Readings is activated, this is the maximum amount of time to wait for a reading to meet the accuracy threshold. If this timeout is reached before a valid reading is obtained, the best reading obtained up to the timeout is provided.

Use Multiple Readings

An optional input of Type Boolean. When set to true, it activates the same geolocation method as that used by the HTML5 Viewer. The default is false. Timeout is affected when this mode is active.

The accuracy of the results is device-dependent. You can increase the timeout value and decrease the accuracy threshold until you obtain optimum accuracy for the device.


Display Name


You can change the name of an activity to one that describes what it does. A descriptive name can make a workflow easier to interpret and maintain.

External Id

An activity handler within a client can reference this particular activity using this external identifier.

Out Arguments


The accuracy of the latitude and longitude coordinates in meters.


The result altitude in meters above the WGS84 ellipsoid.

Altitude Accuracy

The accuracy of the altitude in meters.

Error Code

The error code associated with a failed geolocation attempt. Where: 1 = Permission Denied; 2 = Position Unavailable; 3 = Timeout.

Error Message

The error message associated with a failed geolocation attempt.


The direction that the hosting device is travelling - in degrees, where 0° >= heading < 360°, counting clockwise relative to true north.


The position result - latitude.


The position result - longitude.


The result - current position in WGS84.


The magnitude of the horizontal component of the hosting device's current velocity in meters per second.


The timestamp of the time that the position was acquired.

The values returned in the Out Arguments for many of these fields will be device-dependent.

Version Information:

Supported from: Geocortex Essentials 3.10, Geocortex Viewer for HTML5 1.1.