Class Geolocation.PositionOptions
java.lang.Object
com.google.gwt.geolocation.client.Geolocation.PositionOptions
- Enclosing class:
Geolocation
Additional options for receiving the user's location.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsetHighAccuracyEnabled
(boolean enabled) Sets whether or not the application will request a more accurate position from the browser.setMaximumAge
(int maximumAge) Allows the browser to return a position immediately with a cached position.setTimeout
(int timeout) Sets the amount of time (in milliseconds) that the application is willing to wait before getting the user's position.
-
Constructor Details
-
PositionOptions
public PositionOptions()
-
-
Method Details
-
setHighAccuracyEnabled
Sets whether or not the application will request a more accurate position from the browser.If the browser supports this option, the user will be prompted to grant permission to this application, even if permission to get the user's (less accurate) position has already been granted.
Requesting high accuracy may be slower, or not supported at all, depending on the browser.
By default this is
false
-
setMaximumAge
Allows the browser to return a position immediately with a cached position. The maximum age is then the oldest acceptable cached position. If no acceptable cached position is found, the browser will locate the user and cache and return the position.By default this is 0, which means that the position cache will not be used.
-
setTimeout
Sets the amount of time (in milliseconds) that the application is willing to wait before getting the user's position. If a request for position takes more than this amount of time, an error will result.By default this is -1, which means there is no application-specified timeout.
-