GeolocationManager
Added in version 2.26.
Superclasses: Object
Geolocation manager.
WebKitGeolocationManager provides API to get the geographical position of the user.
Once a WebKitGeolocationPermissionRequest
is allowed, when WebKit needs to know the
user location GeolocationManager
::start signal is emitted. If the signal is handled
and returns True
, the application is responsible for providing the position every time it’s
updated by calling update_position()
. The signal GeolocationManager
::stop
will be emitted when location updates are no longer needed.
Methods
- class GeolocationManager
- failed(error_message: str) None
Notify
manager
that determining the position failed.Added in version 2.26.
- Parameters:
error_message – the error message
- update_position(position: GeolocationPosition) None
Notify
manager
that position has been updated toposition
.Added in version 2.26.
- Parameters:
position – a
GeolocationPosition
Properties
- class GeolocationManager
- props.enable_high_accuracy: bool
Whether high accuracy is enabled. This is a read-only property that will be set to
True
when aGeolocationManager
needs to get accurate position updates. You can connect to notify::enable-high-accuracy signal to monitor it.Added in version 2.26.
Signals
- class GeolocationManager.signals
- start() bool
The signal is emitted to notify that
manager
needs to start receiving position updates. After this signal is emitted the user should provide the updates usingupdate_position()
every time the position changes, or usefailed()
in case it isn’t possible to determine the current position.If the signal is not handled, WebKit will try to determine the position using GeoClue if available.
Added in version 2.26.