Skip to content

Tiles Layer

Colored tiles tiling the globe surface

The tiles layer places flat, rectangular tiles tangent to the surface, each with its own three.js material. Each tile is a TileDatum, and materials are described by GlobeMaterialSpec.

from IPython.display import display

from pyglobegl import (
    GlobeConfig,
    GlobeMaterialSpec,
    GlobeWidget,
    TileDatum,
    TilesLayerConfig,
)

tiles = [
    TileDatum(
        lat=0,
        lng=0,
        width=10,
        height=10,
        material=GlobeMaterialSpec(
            type="MeshLambertMaterial",
            params={"color": "#66ccff", "opacity": 0.6, "transparent": True},
        ),
    )
]

config = GlobeConfig(tiles=TilesLayerConfig(tiles_data=tiles))

display(GlobeWidget(config=config))

TileDatum and GlobeMaterialSpec

  • TileDatumlat, lng, width, height (in degrees), altitude, rotation, and a material.
  • GlobeMaterialSpec — a three.js material type (for example MeshLambertMaterial) and a params dict forwarded to that material's constructor.

From a GeoDataFrame

tiles_from_gdf builds tiles from point geometries with width / height columns. See GeoPandas helpers.