TileOverlay

data class TileOverlay(val tileProvider: TileProvider, val transparency: Float = 0.0f, val zIndex: Float = 0.0f, val visible: Boolean = true, val fadeIn: Boolean = false, val tag: Any? = null)(source)

Represents a tile overlay layer on the map.

Tile overlays display additional tile-based content on top of or below the base map tiles. Common use cases include:

  • Weather overlays (temperature, precipitation, clouds)

  • Transportation overlays (railways, public transit)

  • Outdoor activity overlays (hiking trails, ski pistes)

  • Maritime overlays (nautical charts, depth contours)

  • Custom map styles or data visualizations

Tile overlays use the same 256×256 pixel tiling system as the base map, with tiles loaded dynamically based on the viewport and zoom level.

Example usage:

// Direct instantiation (Kotlin style)
val overlay = TileOverlay(
tileProvider = OpenSeaMapProvider(),
transparency = 0.0f,
zIndex = 1.0f,
visible = true
)
mapView.addTileOverlay(overlay)

// Builder pattern (Google Maps style)
val overlay = TileOverlayOptions()
.tileProvider(OpenSeaMapProvider())
.transparency(0.0f)
.zIndex(1.0f)
.visible(true)
mapView.addTileOverlay(overlay)

See also

Constructors

Link copied to clipboard
constructor(tileProvider: TileProvider, transparency: Float = 0.0f, zIndex: Float = 0.0f, visible: Boolean = true, fadeIn: Boolean = false, tag: Any? = null)

Properties

Link copied to clipboard

Whether tiles fade in when loaded (currently not implemented)

Link copied to clipboard
val tag: Any?

User data associated with this overlay

Link copied to clipboard

Provider for tile data

Link copied to clipboard

Overlay transparency (0.0 = opaque, 1.0 = fully transparent)

Link copied to clipboard

Whether the overlay is visible

Link copied to clipboard

Draw order (higher values drawn on top, base tiles are at 0.0)

Functions

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun withTransparency(transparency: Float): TileOverlay

Returns a copy of this overlay with modified properties.

Link copied to clipboard

Returns a copy of this overlay with modified visibility.

Link copied to clipboard

Returns a copy of this overlay with modified z-index.