Geolocation is the ability of your web browser to report the current location of your computer or mobile device. These values are reported as latitude and longitude coordinates, which ToolBook can access via the web browser on the device. Information on the current location can then be used within a ToolBook lesson, allowing you to create location-aware training.
A few situations in which ToolBook’s geolocation services could be used effectively:
- A course that displays information to the user based on his or her location; such an example could be the display of job training content pertinent to the factory floor versus a store front
- Content on fire safety training, that could now be enabled to detect if the user can physically locate various fire exits in their building.
- The owner of a chain of coffee stands might have specific delivery instructions for a driver. The proper instructions could be displayed as soon as the driver arrives on location, without having to look them up.
Browsers/devices and geolocation support
At the time ToolBook 10.5 was released, geolocation was supported only by some browsers/devices. Any browser and device combination that supports the W3C standard API should integrate with ToolBook courseware. Platforms that are known to support this standard include:
Firefox 3.5 and higher
Safari 5.0 and higher
iPhone/iPod touch 3.0 and higher, iPad
Android 2.0 and higher
Platforms that do not support the W3C standard include
Internet Explorer 6, 7 or 8
Windows Mobile 6.5
Common reasons for failures
Geolocation values are not reported in the following cases:
- If the device or browser does not support geolocation.
- If users do not ALLOW the sharing of their location.
- If the geolocation feature of the browser or device is not yet ready (isGeolocationReady of this book will report TRUE when it is ready to be used).
Given the above facts, a lesson design recommendation is that geolocation be used to make course content more personalized, but not to make the course design depend on geolocation information being known.
What is the typical user experience with geolocation?
When users access geolocation-aware content, they will view a dialog or an alert bar across the top of the browser asking them for permission to access their current location. Typically, the options presented to the user are Allow or Deny.
Please note that geolocation information accessible to ToolBook is not generated from ToolBook. It is provided by a mobile device or browser using technologies such as GPS, Cell Tower Triangulation, IP Address origin information, or information on the location of known wireless networks. In other words, ToolBook merely asks the browser for the location, and the browser in turn asks the device for the location. ToolBook does not generate this information and therefore is not in control of the accuracy, or availability of this information.
A further word of caution here: There is always a margin of error with any reported location, which is referred to as Accuracy, a fluctuating value reported in meters. For example, if the reported Accuracy is 800, this means the current geolocation could be off by plus or minus 800 meters. Avoid using geolocation values which are reported with unacceptably large Accuracy values.
How does ToolBook implement geolocation?
Geolocation has been implemented by introducing five book properties, adding events to the book, background and page, and using a specific geolocation function in the Actions Editor:
The isGeolocationSupported book property will reveal if the device supports geolocation abilities.
The isGeolocationReady book property will reveal if the geolocation information is currently available. It can take some time for this information to become available once first requested.
- currentLatitude and currentLongitude
The currentLatitude and currentLongitude book properties will return real numbers from 0 to 360 (degrees) if geolocation is supported and available. Otherwise both values will return 0. In other words, these values will report 0 until the geolocation feature is ready. It will not report ready until device/browser is ready to deliver location and until the user has allowed the sharing of their location.
The currentGeolocationAccuracy book property will return a number revealing how accurate (in meters) the reported location is. This value can fluctuate because of the imprecise nature of how the triangulation of a geolocation position works. This will report 0 if geolocation is not ready or not available.
- On geolocation ready
This event will be sent to the book, current background and current page, when geolocation services report that they are ready.
- On geolocation change
This event will be sent to the book when the geolocation changes.
The distance (in meters) between two points on the globe (specified as decimal latitude and longitude values). To use this function, 4 parameters are required as shown:
ToolBook determines the values of latitude1 and longitude1 from the user's current position, but for latitude2 and longitude2, you will need to specify the latitude and longitude values (in decimal degrees format) of the known location used as the point of reference.
The getGeolocationDistance function should not be used without first programmatically checking to see if the reported latitude/longitude are non-Zero values. If you don't do this, you will in effect be measuring from wherever location 0, 0 is on the globe.
Here's a general overview of the ToolBook implementation of geolocation support. Actions Editor logic can be written to do the following:
- Checks if Geolocation is supported (if isGeolocationSupported of this book = true)
- Checks if Geolocation is ready (if isGeolocationReady of this book = true)
- Asks users permission to use their current location
Users are automatically prompted to Allow or Deny access to their location the moment any Actions Editor logic tries to access any of the book's geolocation properties; or if the book, page, or background accessed by the user has an action sequence for the events "On geolocation ready" or "on geolocation change".
To ensure that users are asked for permission to access their current location the moment the lesson opens, it is recommended that this logic be added to the Book actions script:
on load book
if isGeolocationReady of self = true
This logic does not actually do anything, but the act of checking the isGeolocationReady book property will cause the user to be prompted to allow or deny the sharing of their location.
- Calculates the distance between the current location and a known location.
- The getGeolocationDistance function in the Actions Editor calculates the distance between two sets of latitude and longitude coordinates. This distance is reported in meters.
- For example, where Seattle is at Latitude 47.5661 and Longitude -122.3474, the distance in meters will be computed as: getGeolocationDistance( curLat, curLong, 47.5661, -122.3474 )
Finding the latitude and longitude coordinates of any given location, using Google Maps
- Using your desktop browser, go to maps.google.com.
- Zoom into the location of your choice.
- Right-Click and choose What's Here?
- Google Maps will show the latitude and longitude coordinates of that location, in the search field at the top of the search window.
KEYWORDS: 23788 P23788
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad