DataSourceRequest
Added in version 1.1.
Superclasses: Object
- Constructors:
DataSourceRequest(**properties)
new(x:int, y:int, zoom_level:int) -> Shumate.DataSourceRequest
Constructors
- class DataSourceRequest
- classmethod new(x: int, y: int, zoom_level: int) DataSourceRequest
Creates a new
DataSourceRequest
.Only implementations of
start_request
should need to construct a new request object.Added in version 1.1.
- Parameters:
x – X coordinate of the requested tile
y – Y coordinate of the requested tile
zoom_level – Zoom level of the requested tile
Methods
- class DataSourceRequest
- complete() None
Marks the request as complete. No more data or errors may be emitted.
This can only be called if data has been emitted. If there is no data, use
emit_error
instead, which will automatically complete the request.Added in version 1.1.
- emit_data(data: Bytes, complete: bool) None
Emits tile data as a response to the request. This sets the
data
property.If
complete
isTrue
, thencompleted
is set toTrue
as well.Added in version 1.1.
- Parameters:
data – the data to emit
complete –
True
to also complete the request,False
otherwise
- emit_error(error: GError) None
Emits a fatal error in response to the request. This completes the request, so no more data or errors can be emitted after this. Non-fatal errors should not be reported.
If
data
was previously set, it will be cleared.Added in version 1.1.
- Parameters:
error – an error
Properties
- class DataSourceRequest
- props.completed: bool
True
if the request has been completed, otherwiseFalse
. A completed request will not receive further updates to eitherdata
orerror
.Added in version 1.1.
- props.data: Bytes
The most recent data for the tile, if available. If an error is emitted, this will be set to
None
.Added in version 1.1.
- props.error: GError
The error that occurred during the request, if any.
Added in version 1.1.
Fields
- class DataSourceRequest
- parent_instance