Tile Overlay
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
val overlay = TileOverlayOptions()
.tileProvider(OpenSeaMapProvider())
.transparency(0.0f)
.zIndex(1.0f)
.visible(true)
mapView.addTileOverlay(overlay)The overlay is a live handle, as returned by OpenMapView.addTileOverlay: setting a property, e.g. overlay.transparency = 0.5f, redraws the map right away and keeps the overlay's downloaded tiles, and remove takes it off the map. Java code uses the getters and setters, e.g. overlay.setTransparency(0.5f).
Parameters
Provider for tile data
Overlay transparency (0.0 = opaque, 1.0 = fully transparent)
Draw order (higher values drawn on top, base tiles are at 0.0)
Whether the overlay is visible
Whether tiles fade in when loaded (currently not implemented)
User data associated with this overlay
See also
Properties
Functions
Drops the downloaded tiles of this overlay, so they are requested again, e.g. after the data behind the tileProvider changed.
Returns a new overlay with the given properties changed, not added to any map.