@@ -41,19 +41,20 @@ public class GeolocationOptions {
4141 * If true and if the device is able to provide a more accurate position, it will do so. This may
4242 * result in slower response times or increased power consumption.
4343 */
44- private Boolean enableHighAccuracy ;
44+ private boolean enableHighAccuracy ;
4545
4646 /**
4747 * A positive long value representing the maximum length of time (in milliseconds) the device is
48- * allowed to take in order to return a position.
48+ * allowed to take in order to return a position.
49+ * If null, the device won't timeout until the position is available.
4950 */
5051 private Long timeout ;
5152
5253 /**
5354 * A positive long value representing the maximum age (in milliseconds) of a possible cached
5455 * position that is acceptable to return.
5556 */
56- private Long maximumAge ;
57+ private long maximumAge ;
5758
5859 /**
5960 * Converts the options to a JsonObject to be sent to the client-side.
@@ -62,15 +63,11 @@ public class GeolocationOptions {
6263 */
6364 public JsonObject toJson () {
6465 JsonObject json = Json .createObject ();
65- if (enableHighAccuracy != null ) {
66- json .put ("enableHighAccuracy" , enableHighAccuracy );
67- }
66+ json .put ("enableHighAccuracy" , enableHighAccuracy );
67+ json .put ("maximumAge" , maximumAge );
6868 if (timeout != null ) {
6969 json .put ("timeout" , timeout );
7070 }
71- if (maximumAge != null ) {
72- json .put ("maximumAge" , maximumAge );
73- }
7471 return json ;
7572 }
7673}
0 commit comments