MapboxMapController

class MapboxMapController(val mapView: MapView, context: Context, val account: XweatherAccount?, lifecycleOwner: LifecycleOwner) : MapController

Mapbox map controller.

Parameters

lifecycleOwner

Constructors

Link copied to clipboard
constructor(mapView: MapView, context: Context, account: XweatherAccount?, lifecycleOwner: LifecycleOwner)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val account: XweatherAccount?

Your XweatherAccount that contains your userID and userSecret.

Link copied to clipboard
open override var centerLatLng: Coordinate
Link copied to clipboard
var layers: MutableMap<String, MapLayer<TileData, LayerRenderContext<Any>>>
Link copied to clipboard
var mapboxMap: MapboxMap
Link copied to clipboard
val mapView: MapView

The view that contains the map from the activity.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Usually 60, 90, 120

Link copied to clipboard
var service: WeatherService
Link copied to clipboard
val size: Size
Link copied to clipboard
Link copied to clipboard
val type: Int
Link copied to clipboard
open override val viewport: Viewport
Link copied to clipboard
val zoomOffset: Int = 0

-1 is fast, 1 is sharper. This is also sent to TileLayer.

Functions

Link copied to clipboard
open fun add(layerID: String, layerHost: CustomLayerHost)
Link copied to clipboard
fun addSource(layerId: String, sourceId: String = "blank", descriptor: SourceDescriptor?): DataSource
Link copied to clipboard
fun addWeatherLayer(config: WeatherService.WeatherLayerConfiguration, code: String? = null, beforeId: String? = null): TileLayer?
Link copied to clipboard
open override fun getBearing(): Double
Link copied to clipboard
open override fun getBounds(): LatLonBounds
Link copied to clipboard
open override fun getCenter(): Coordinate
Link copied to clipboard
open override fun getFov(): Double
Link copied to clipboard
fun getLayer(id: String): MapLayer<TileData, LayerRenderContext<Any>>?

Returns the layer associated with the specified identifier if it exists.

Link copied to clipboard
Link copied to clipboard
open override fun getPitch(): Double
Link copied to clipboard
open override fun getSize(): Size
Link copied to clipboard
fun getWeatherLayer(code: String): MapLayer<TileData, LayerRenderContext<Any>>?
Link copied to clipboard
open override fun getZoom(): Double
Link copied to clipboard

Returns whether the map currently contains a layer with the specified identifier.

Link copied to clipboard

Returns whether the map currently contains a data source with the specified identifier.

Link copied to clipboard
fun hasWeatherLayer(layer: MapLayer<TileData, LayerRenderContext<Any>>): Boolean

Returns whether the map currently contains a weather layer with the specified identifier.

Link copied to clipboard
open override fun off(name: String, callback: (event: Any) -> Unit)
Link copied to clipboard
open override fun on(name: String, callback: (event: Any) -> Unit)
Link copied to clipboard
suspend fun onMoveEnd()
Link copied to clipboard
open override fun redraw()
Link copied to clipboard
fun removeWeatherLayer(layer: MapLayer<TileData, LayerRenderContext<Any>>)

Removes a weather layer from the map.

open override fun removeWeatherLayer(layerID: String)

Removes a layer from the map.

Link copied to clipboard
fun setBearing(bearing: Double)
Link copied to clipboard
open override fun setCenter(center: Coordinate)
Link copied to clipboard
fun setLayerVisible(id: String, visible: Boolean = true)

Shows or hides the layer with matching id

Link copied to clipboard
fun setPaintProperty(layerId: String, property: String, value: Any)
Link copied to clipboard
fun setPitch(pitch: Double)
Link copied to clipboard
open override fun setZoom(zoom: Double)
Link copied to clipboard
open override fun updateCenterLatLngFromMap()
Link copied to clipboard
fun updateTiles(updateCamera: Boolean = false)

Called when a tile loads and when buttons are pressed. Update Camera is false when tile loads, true when buttons are pressed.