Package org.htmlunit.javascript.host.geo
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
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
FieldsModifier and TypeFieldDescriptionprivate 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
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
-
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 callbackerrorCallback
- optional error callbackoptions
- 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 callbackerrorCallback
- optional error callbackoptions
- 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()
-