Geolocate Module
Most of the Geolocate Module's properties can be configured using Manager. For instructions, see Geolocation.
The Geolocate Module implements geolocation in the Geocortex Viewer for HTML5.
Geolocation locates the user on the map. The HTML5 Viewer supports the following geolocation options:
-
Find Me: Pans the map to the user's location and marks the location with an indicator.
-
Track Me: Tracks the user's location with an indicator, without panning the map.
-
Follow Me: Follows the user's location with an indicator and pans the map as the user's location changes.
Geolocation menu (), location indicator (), accuracy circle (), and geolocation coordinates ()
It is not possible to use the Geolocate tool at the same time as another tool because geolocation may interfere with any tool that collects information from the user. For example, the map could move while the user is drawing a shape, leading to undesirable results.
Browser Support
Web browsers return geolocation results in WGS 84. If your map is not in Web Mercator or WGS 84, you must configure an ArcGIS geometry service so the geolocation map widget can project from latitude/longitude to the map's coordinates. For instructions on configuring a geometry service, see Geometry Services.
Each web browser handles geolocation differently. For example, as of Chrome 50.0, your site needs to be secured with HTTPS in order to use the Geolocation API. If you or your users intend to use geolocation, ensure that your preferred web browser uses geolocation and that it is compatible with your site. Here are two common scenarios where geolocation is not available to users:
-
Chrome 50+: Your site needs to be secured with HTTPS in order to use the Geolocation API.
-
Internet Explorer Enterprise Mode: Internet Explorer Enterprise Mode may emulate Internet Explorer 8, which does not support geolocation.
It is common for devices to ask permission before websites can use geolocation. If geolocation is not working, ensure that the viewer has been given sufficient geolocation privileges. Also ensure that the devices location services are enabled.
In order for an HTML5 viewer to perform geolocation operations, the user's device must have a built-in GPS (Global Positioning System), a Wi-Fi connection, or a wired connection. GPS provides the most accurate geolocation results. Wi-Fi is less accurate than GPS, and geolocation using a wired connection is less accurate than Wi-Fi.
Some devices use a mix of GPS and Wi-Fi to obtain a location. This can result in unpredictable readings. Accuracy is improved by setting the device to GPS-only mode, however, this drains the battery more quickly in some devices.
Configuration Properties
Module
No configuration
properties
Views
-
GeolocateView
: Noconfiguration
properties -
GeolocateStatusView
: Noconfiguration
properties
View Models
-
GeolocateViewModel
:-
geolocateEnabled
: To display the option for single-reading geolocation (Find Me), set totrue
. The default istrue
for the Tablet and Handheld interfaces, andfalse
for the Desktop interface. When used, the map pans to the user's current location, as indicated by a marker. -
trackingEnabled
: To display the option for tracking the user's location (Track Me), set totrue
. The default istrue
for the Tablet and Handheld interfaces, andfalse
for the Desktop interface. When used, the user's location is tracked with a marker, without panning the map. -
followingEnabled
: To display the option for following the user's location (Follow Me), set totrue
. The default istrue
for the Tablet and Handheld interfaces, andfalse
for the Desktop interface. When used, the user's location is followed with a marker, and pans the map as the user's location changes. -
enableHighAccuracy
: To enable have the GPS provide the most accurate position possible, set totrue
. The default istrue
. Setting this property totrue
may result in slower response times or increased power consumption. -
singleGeolocationProfiles
: An object whose properties define a number of named single-reading geolocation profiles. By default, these profiles are:default
,coarse
andfine
. A profile has the following properties:-
accuracyThreshold
: A number representing the accuracy radius, in meters, that satisfies a single-reading geolocation.
-
timeLimit
: A number representing the duration, in milliseconds, to refine the accuracy of a single-reading geolocation.
-
-
geolocateAccuracyCircleEnabled
: To enable the geolocation accuracy circle, set totrue
. The default istrue
. When enabled, the marker for the user's position includes a surrounding circle that indicates the margin of error of the user's position; the user's actual position should lie somewhere within this circle. -
adjustExtentZoomOnGeolocate
: To enable zooming to the user's location upon single-reading geolocation and following, set totrue
; otherwise set tofalse
. The default istrue
. -
geolocateExtentZoomLevel
: The scale to which to zoom whenadjustExtentZoomOnGeolocate
is set totrue
. The default is50000
(to 1). -
geolocationIndicator
: The URL to the image that represents the geolocation indicator. If this property is omitted, the default is an image of a blue dot located atResources/Images/Icons/geolocate-position-32.png
.
-
-
GeolocateStatusViewModel
:-
showGeolocateCoordinates
: When this property istrue
, Find Me operations show the coordinates of the user's location, in addition to showing the geolocation indicator. If you do not want to show the coordinates for Find Me operations , setshowGeolocateCoordinates
tofalse
. -
showTrackingCoordinates
: When this property istrue
, Track Me operations show the coordinates of the user's location, in addition to showing the geolocation indicator. If you do not want it show the coordinates for Track Me operations, setshowTrackingCoordinates
tofalse
. -
showFollowingCoordinates
: When this property istrue
, Follow Me operations show the coordinates of the user's location, in addition to showing the geolocation indicator. If you do not want to show the coordinates for Follow Me operations, setshowFollowingCoordinates
tofalse
. -
coordinateFormat
: The units to use for displaying the coordinates. The options are:-
Degrees/Decimal Minutes: Set
coordinateFormat
toddm
. -
Degrees/Minutes/Seconds: Set
coordinateFormat
todms
. -
Latitude/Longitude: Set
coordinateFormat
todd
. -
X/Y: Set
coordinateFormat
toxy
. By default, X/Y coordinates are shown in the map's spatial reference. To change the spatial reference that is used for X/Y coordinates, configure thecoordinateWkid
property.
-
-
coordinateWkid
: The well-known ID of the coordinate system to use for X/Y coordinates. -
coordinateFractionalDigits
: The number of decimal digits to show in the coordinates.This precision setting cannot exceed the maximum representable IEEE 754 floating point. This is specified in the IEEE 754 standard. See double-precision floating-point format and significant figures for more information.
-
geolocateIcon
: The icon to show beside the coordinates for Find Me operations. -
busyIcon
: The icon to show beside the coordinates when the geolocation map widget is tracking or following the user.
-
See also...