Skip to content

lonboard.basemap

lonboard.basemap.MaplibreBasemap

Bases: BaseWidget

A MapLibre GL JS basemap.

mode class-attribute instance-attribute

mode = tag(sync=True)

The basemap integration mode.

This determines how deck.gl and MapLibre are rendered together.

  • "interleaved":

    The interleaved mode renders deck.gl layers into the same context created by MapLibre.

    If you need to mix deck.gl layers with MapLibre layers, e.g. having deck.gl surfaces below text labels, or objects occluding each other correctly in 3D, then you have to use this option.

    See BaseLayer.before_id for more information on how to interleave deck.gl layers into the Maplibre layer stack.

  • "overlaid":

    The overlaid mode renders deck.gl in a separate canvas inside the MapLibre's controls container.

    If your use case does not require interleaving, but you still want to use certain features of maplibre-gl, such as Maplibre-based controls, then you should use this option.

  • "reverse-controlled":

    The reverse-controlled mode renders deck.gl above the MapLibre container and blocks any interaction to the base map.

    This is the mode that Lonboard has historically used.

Default: "overlaid"

style class-attribute instance-attribute

style = tag(sync=True)

A MapLibre-compatible basemap style.

Various styles are provided in CartoStyle.

__init__

__init__(
    *,
    mode: Literal["interleaved", "overlaid", "reverse-controlled"] = "overlaid",
    style: str | CartoStyle = PositronNoLabels
) -> None

Create a MapLibre GL JS basemap.

lonboard.basemap.CartoStyle

Bases: str, Enum

Maplibre-supported vector basemap styles provided by Carto.

Refer to Carto documentation for information on styles.

DarkMatter class-attribute instance-attribute

DarkMatter = 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json'

A dark map style with labels.

DarkMatterNoLabels class-attribute instance-attribute

DarkMatterNoLabels = (
    "https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json"
)

A dark map style without labels.

Positron class-attribute instance-attribute

Positron = 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json'

A light map style with labels.

PositronNoLabels class-attribute instance-attribute

PositronNoLabels = (
    "https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json"
)

A light map style without labels.

Voyager class-attribute instance-attribute

Voyager = 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json'

A light, colored map style with labels.

VoyagerNoLabels class-attribute instance-attribute

VoyagerNoLabels = (
    "https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"
)

A light, colored map style without labels.