Top |
WebKitGeolocationManager provides API to get the geographical position of the user.
Once a WebKitGeolocationPermissionRequest is allowed, when WebKit needs to know the
user location “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 webkit_geolocation_manager_update_position()
. The signal “stop”
will be emitted when location updates are no longer needed.
void webkit_geolocation_manager_update_position (WebKitGeolocationManager *manager
,WebKitGeolocationPosition *position
);
Notify manager
that position has been updated to position
.
Since: 2.26
void webkit_geolocation_manager_failed (WebKitGeolocationManager *manager
,const char *error_message
);
Notify manager
that determining the position failed.
Since: 2.26
gboolean
webkit_geolocation_manager_get_enable_high_accuracy
(WebKitGeolocationManager *manager
);
Get whether high accuracy is enabled.
Since: 2.26
WebKitGeolocationPosition * webkit_geolocation_position_new (double latitude
,double longitude
,double accuracy
);
Create a new WebKitGeolocationPosition
latitude |
a valid latitude in degrees |
|
longitude |
a valid longitude in degrees |
|
accuracy |
accuracy of location in meters |
Since: 2.26
WebKitGeolocationPosition *
webkit_geolocation_position_copy (WebKitGeolocationPosition *position
);
Make a copy of the WebKitGeolocationPosition
Since: 2.26
void
webkit_geolocation_position_free (WebKitGeolocationPosition *position
);
Free the WebKitGeolocationPosition
Since: 2.26
void webkit_geolocation_position_set_timestamp (WebKitGeolocationPosition *position
,guint64 timestamp
);
Set the position
timestamp. By default it's the time when the position
was created.
Since: 2.26
void webkit_geolocation_position_set_altitude (WebKitGeolocationPosition *position
,double altitude
);
Set the position
altitude
Since: 2.26
void webkit_geolocation_position_set_altitude_accuracy (WebKitGeolocationPosition *position
,double altitude_accuracy
);
Set the accuracy of position
altitude
Since: 2.26
void webkit_geolocation_position_set_heading (WebKitGeolocationPosition *position
,double heading
);
Set the position
heading, as a positive angle between the direction of movement and the North
direction, in clockwise direction.
Since: 2.26
void webkit_geolocation_position_set_speed (WebKitGeolocationPosition *position
,double speed
);
Set the position
speed
Since: 2.26
typedef struct _WebKitGeolocationPosition WebKitGeolocationPosition;
WebKitGeolocationPosition is an opaque struct used to provide position updates to a
WebKitGeolocationManager using webkit_geolocation_manager_update_position()
.
Since: 2.26
“enable-high-accuracy”
property“enable-high-accuracy” gboolean
Whether high accuracy is enabled. This is a read-only property that will be
set to TRUE
when a WebKitGeolocationManager needs to get accurate position updates.
You can connect to notify::enable-high-accuracy signal to monitor it.
Owner: WebKitGeolocationManager
Flags: Read
Default value: FALSE
Since: 2.26
“start”
signalgboolean user_function (WebKitGeolocationManager *manager, gpointer user_data)
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 webkit_geolocation_manager_update_position()
every time
the position changes, or use webkit_geolocation_manager_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.
manager |
the WebKitGeolocationManager on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
TRUE
to stop other handlers from being invoked for the event.
FALSE
to propagate the event further.
Flags: Run Last
Since: 2.26
“stop”
signalvoid user_function (WebKitGeolocationManager *manager, gpointer user_data)
The signal is emitted to notify that manager
doesn't need to receive
position updates anymore.
manager |
the WebKitGeolocationManager on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.26