Class Geolocation

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.geo.Geolocation
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class Geolocation extends HtmlUnitScriptable
A JavaScript object for Geolocation.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.htmlunit.corejs.javascript.Function
     
    private static final org.apache.commons.logging.Log
     
    private org.htmlunit.corejs.javascript.Function
     

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clearWatch(int watchId)
    Clears the specified watch ID.
    (package private) void
     
    void
    getCurrentPosition(org.htmlunit.corejs.javascript.Function successCallback, org.htmlunit.corejs.javascript.Function errorCallback, Object options)
    Gets the current position.
    void
    Creates an instance.
    int
    watchPosition(org.htmlunit.corejs.javascript.Function successCallback, Object errorCallback, Object options)
    Notifies the callbacks whenever the position changes, till clearWatch() is called.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • successHandler_

      private org.htmlunit.corejs.javascript.Function successHandler_
    • errorHandler_

      private org.htmlunit.corejs.javascript.Function errorHandler_
  • Constructor Details

    • Geolocation

      public Geolocation()
      Creates an instance.
  • Method Details

    • jsConstructor

      public void jsConstructor()
      Creates an instance.
    • getCurrentPosition

      public void getCurrentPosition(org.htmlunit.corejs.javascript.Function successCallback, org.htmlunit.corejs.javascript.Function errorCallback, Object options)
      Gets the current position.
      Parameters:
      successCallback - success callback
      errorCallback - optional error callback
      options - optional options
    • watchPosition

      public int watchPosition(org.htmlunit.corejs.javascript.Function successCallback, Object errorCallback, Object options)
      Notifies the callbacks whenever the position changes, till clearWatch() is called.
      Parameters:
      successCallback - success callback
      errorCallback - optional error callback
      options - optional options
      Returns:
      the watch id
    • clearWatch

      public void clearWatch(int watchId)
      Clears the specified watch ID.
      Parameters:
      watchId - the watch id
    • doGetPosition

      void doGetPosition()