Package com.mapbox.maps.extension.observable

Types

Error
Link copied to clipboard

The data class for error in Observer

data class Error(reason: String, message: String)
EventData
Link copied to clipboard

The data class for event data in Observer

data class EventData(dataSource: String, request: Request, response: Response, cancelled: Boolean)
Request
Link copied to clipboard

The request data class that included in EventData

data class Request(loadingMethod: List<String>, url: String, kind: String, priority: String)
Response
Link copied to clipboard

The response data class that included in EventData

data class Response(eTag: String, mustRevalidate: Boolean, noContent: Boolean, modified: String, offlineData: Boolean, notModified: Boolean, expires: String, size: Int, error: Error?)

Functions

getEventData
Link copied to clipboard

Get the parsed event data.

fun Event.getEventData(): EventData
subscribeResourceRequest
Link copied to clipboard

Subscribes an Observer for of event type"resource-request". Observable will hold a strong reference to an Observer instance, therefore, in order to stop receiving notifications, caller must call unsubscribe with an Observer instance used for an initial subscription.

fun ObservableInterface.subscribeResourceRequest(observer: Observer)
unsubscribeResourceRequest
Link copied to clipboard

Unsubscribes an Observer for event types "resource-request".

fun ObservableInterface.unsubscribeResourceRequest(observer: Observer)