Class Geolocation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • 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 errorHandler_  
      private static org.apache.commons.logging.Log LOG  
      private org.htmlunit.corejs.javascript.Function successHandler_  
      • 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
      Geolocation()
      Creates an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearWatch​(int watchId)
      Clears the specified watch ID.
      (package private) void doGetPosition()  
      void getCurrentPosition​(org.htmlunit.corejs.javascript.Function successCallback, org.htmlunit.corejs.javascript.Function errorCallback, java.lang.Object options)
      Gets the current position.
      void jsConstructor()
      Creates an instance.
      int watchPosition​(org.htmlunit.corejs.javascript.Function successCallback, java.lang.Object errorCallback, java.lang.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 Detail

      • 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 Detail

      • Geolocation

        public Geolocation()
        Creates an instance.
    • Method Detail

      • jsConstructor

        public void jsConstructor()
        Creates an instance.
      • getCurrentPosition

        public void getCurrentPosition​(org.htmlunit.corejs.javascript.Function successCallback,
                                       org.htmlunit.corejs.javascript.Function errorCallback,
                                       java.lang.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,
                                 java.lang.Object errorCallback,
                                 java.lang.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()