MapController

abstract class MapController(val mapView: MapView, val account: XweatherAccount) : ViewModel, MapProvider, DefaultLifecycleObserver

A MapController class acts as the interface between the map view of a mapping library and MapsGL-specific functionality.

Inheritors

Constructors

Link copied to clipboard
constructor(mapView: MapView, account: XweatherAccount)

Properties

Link copied to clipboard
val account: XweatherAccount
Link copied to clipboard
lateinit var centerLatLng: Coordinate
Link copied to clipboard
Link copied to clipboard
val mapView: MapView
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Fired when all data sources have finished loading.

Link copied to clipboard

Fired when loading begins for any data source.

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

instance used for managing animation and time-based data.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun add(layerID: String, layerHost: CustomLayerHost)
Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun <P : LayerPaint> addLayer(descriptor: LayerDescriptor<P>, beforeID: String?): TileLayer?

Adds a new layer to the map.

Link copied to clipboard
fun addSource(descriptor: SourceDescriptor): DataSource
Link copied to clipboard
fun addWeatherLayer(layerCode: LayerCode, id: String? = null, beforeId: String? = null): TileLayer?

Adds a new weather layer to the map.

fun addWeatherLayer(config: WeatherConfiguration, id: String? = null, beforeId: String? = null): TileLayer?
Link copied to clipboard
open override fun getBearing(): Double

Returns the map's current rotational bearing in degrees, if supported. A bearing of 0 orients the map so that north is up.

Link copied to clipboard
open override fun getBounds(): LatLonBounds
Link copied to clipboard
open override fun getCenter(): Coordinate

Returns the map's geographical center coordinate.

Link copied to clipboard
Link copied to clipboard
open override fun getFov(): Double

Returns the map camera's current field-of-view in degrees.

Link copied to clipboard
fun getLayer(id: String): MapLayer<*, *>?

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

Link copied to clipboard
open override fun getPitch(): Double

Returns the map's current pitch/tilt in degrees, if supported.

Link copied to clipboard
open override fun getSize(): Size

Returns the map's container size.

Link copied to clipboard
Link copied to clipboard

Returns A layer given its LayerCode.

Link copied to clipboard
open override fun getZoom(): Double

Returns the map's current zoom level.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
open fun moveLayer(id: String, beforeId: String?)
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
open override fun onCreate(owner: LifecycleOwner)
Link copied to clipboard
open fun onDestroy(owner: LifecycleOwner)
Link copied to clipboard
open fun onPause(owner: LifecycleOwner)
Link copied to clipboard
open fun onResume(owner: LifecycleOwner)
Link copied to clipboard
open fun onStart(owner: LifecycleOwner)
Link copied to clipboard
open fun onStop(owner: LifecycleOwner)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Removes a layer from the map.

Link copied to clipboard
open fun setCenter(center: Coordinate)

Sets the map's geographical center coordinate.

Link copied to clipboard
open fun setLayerHostToUpdate(layerId: String)

Sets textures to bind

Link copied to clipboard
open 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
Link copied to clipboard
open fun setZoom(zoom: Double)

Sets the map's zoom level.