The GeoLocation object allows you to use geolocation features provided by hardware sensors through the Windows operating system.
The following table lists the members provided by the GeoLocation object.
This object is available through the main object SiteKiosk.
Use the GeoLocation object to query the location of the device you run the script on.
You need a sensor that provides geolocation information and is enabled under the Location and Other Sensors section of the Windows control panel. Note that the sensor might not only need to be active but require a working SIM card to provide actual GPS coordinates.
Note that the path of a file using SiteKiosk objects must be allowed in the
SiteKiosk configuration (Security -> Access -> URL's With Script Permission)
if it is not a browser skin file.
The following example sets the accuracy of the GeoLocation object to high and the report interval to 10 seconds. It will also show an alert window with the new location every time the sensor hardware fires the event that the location has changed.
if(SiteKiosk.GeoLocation != null && SiteKiosk.GeoLocation.
ReportStatus == 4)
SiteKiosk.GeoLocation.HighAccuracy = true;
SiteKiosk.GeoLocation.ReportInterval = 10000;
SiteKiosk.GeoLocation.OnLocationChanged = OnLocationChanged;
var time = new Date();
time.setTime((ole_time - 25569) * 24 * 3600 * 1000);
alert("New Location: " + latitude + " " + longitude +
" " + time);
SiteKiosk v9.0 (and later versions).
Back to top