WebKit2.GeolocationManager

g GObject.Object GObject.Object WebKit2.GeolocationManager WebKit2.GeolocationManager GObject.Object->WebKit2.GeolocationManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

failed (error_message)

get_enable_high_accuracy ()

update_position (position)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

enable-high-accuracy

bool

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

start

The signal is emitted to notify that manager needs to start receiving position updates.

stop

The signal is emitted to notify that manager doesn’t need to receive position updates anymore.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.GeolocationManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.GeolocationManagerClass

Geolocation manager.

WebKit2.GeolocationManager provides API to get the geographical position of the user. Once a WebKit2.GeolocationPermissionRequest is allowed, when WebKit needs to know the user location WebKit2.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 WebKit2.GeolocationManager.update_position(). The signal WebKit2.GeolocationManager ::stop will be emitted when location updates are no longer needed.

New in version 2.26.

failed(error_message)
Parameters:

error_message (str) – the error message

Notify self that determining the position failed.

New in version 2.26.

get_enable_high_accuracy()
Returns:

Whether the setting is enabled.

Return type:

bool

Get whether high accuracy is enabled.

New in version 2.26.

update_position(position)
Parameters:

position (WebKit2.GeolocationPosition) – a WebKit2.GeolocationPosition

Notify self that position has been updated to position.

New in version 2.26.

Signal Details

WebKit2.GeolocationManager.signals.start(geolocation_manager)
Signal Name:

start

Flags:

RUN_LAST

Parameters:

geolocation_manager (WebKit2.GeolocationManager) – The object which received the signal

Returns:

True to stop other handlers from being invoked for the event. False to propagate the event further.

Return type:

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 using WebKit2.GeolocationManager.update_position() every time the position changes, or use WebKit2.GeolocationManager.failed() 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.

New in version 2.26.

WebKit2.GeolocationManager.signals.stop(geolocation_manager)
Signal Name:

stop

Flags:

RUN_LAST

Parameters:

geolocation_manager (WebKit2.GeolocationManager) – The object which received the signal

The signal is emitted to notify that manager doesn’t need to receive position updates anymore.

New in version 2.26.

Property Details

WebKit2.GeolocationManager.props.enable_high_accuracy
Name:

enable-high-accuracy

Type:

bool

Default Value:

False

Flags:

READABLE

Whether high accuracy is enabled. This is a read-only property that will be set to True when a WebKit2.GeolocationManager needs to get accurate position updates. You can connect to notify::enable-high-accuracy signal to monitor it.

New in version 2.26.