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:
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
-
-
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_
-
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.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
-
-
-
-
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 callbackerrorCallback
- optional error callbackoptions
- 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 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()
-
-