Python Layer Guide

Map SDK 3.0's release brought specialized classes for each layer type in Studio. This page provides some examples with a detailed explaination, layer-specifc methods, as well tables defining layer classes and their components.

What's new?

In previous versions, the Map SDK only supported layer configuration by providing a JSON configuration object, which is what Studio application uses to manage the state of your layers.

If you wanted to create a layer, you were required to either create the layer in Studio's front end, then export the JSON via the config editor (which, for many workflows, is still a highly recommended method for creating layers!), or struggle while manually modifying/typing out a JSON file.

Our new robust set of layer classes provide strict type-checking and docstrings, letting you construct layers without leaving the development environment.

By using specialized classes, you are able to access their docstrings very easily (by hovering with a mouse, in most IDEs). You can also Cmd/Ctrl + click to execute a "Go To Definition" and reveal the full details and the implementation of a specific class or method.

Example

👀

Rather see it in action?

Open the notebook from your preferred environment to try it out for yourself.
Binder Colab GitHub

The following is an example shows how to create a layer via a layer class, then add it to the map.


# Assume a map has been created and a dataset initialized

# Create a point layer
point_layer = map_sdk.PointLayer(
    label="Earthquakes layer",
    data_id=DATASET_ID,
    columns=map_sdk.PointLayerNeighborsColumns(
        lat="Latitude",
        lng="Longitude"
    ),
    size_column="Magnitude",
    color_column="Magnitude",
    color_range=map_sdk.ColorRange(
        colors=["#4C0035", "#880030", "#B72F15", "#D6610A", "#EF9100", "#FFC300"],
    )
)

# Add the layer to the map
map.add_layer_from_config(point_layer.to_json())

Let's break down this layer creation approach step-by-step.

First, we create the point layer with the new point layer class. For most of the layer's components, we specify a simple string, such as label, which sets the user-facing label, and size_column and color_column, which selects a column to scale points' size and color.

For other more complex columns we use sub-classes, such as the column selection where we use map_sdk.PointLayerNeighborsColumns, which lets us specify seperate lat and lng columns.

If the dataset were to contain points structured geojson column rather than a lat/lng column, we could specify that by using map_sdk.PointLayerGeojsonColumns.

    columns=map_sdk.PointLayerGeojsonColumns(
        # the column _geojson containing the lat/lng points
        geojson="_geojson",
    ),

It's worth noting that directly using the layer's JSON configuration is still a recommended approach if you have an existing JSON configuration you wish to apply, or wish to create the layer from Studio's front end, then export the JSON via the config editor.

📘

Learn more about these classes

Be sure to read more about the PointLayer (used in this example).

Add Layers to the Map

To add it to the map, we must transform it to a JSON file (the format Studio uses to manages layer and map states) using the to_json() method.

map.add_layer_from_config(point_layer.to_json())

If we ever want to reconfigure the layer, we could simply edit the layer's by directly accessing its attributes, then add it to back to the map. For example:

# If necessary, remove the existing layer
map.remove_layer(map.get_layers()[0])

point_layer.opacity = 0.5
point_layer.id = "earthquake_points_2"
point_layer.label = 'Earthquakes, but with less opacity'

map.add_layer_from_config(point_layer.to_json())

Using to_json effectively transforms your readable, pythonic layer object to a JSON without you needing to interact with the JSON schema at all.

Transform JSON Layer Configuration to Python Class

Many Map SDK users have JSON configurations they would like to use, either exported via the config editor or otherwise stored somewhere for reuse.

You might want to bring the layer's schema to your Python envirnoment and begin configuring it using the classes described above. For example:

# Assume we have a layer configuration big_config.json
point_layer_json = 'big_config.json'

# Use the point layer class to improt the layer config json
point_layer = map_sdk.PointLayer.from_json(point_layer_json)

# Edit it by direct access to attributes

point_layer = {
    "opacity": 0.5,
    "id": "earthquake_points_2",
    "label": "Earthquakes, but with less opacity"
}

# Add the layer to the map
map.add_layer_from_config(point_layer.to_json())

When used in tandem, from_json() and to_json() bridge the gap between the universal, readable JSON format and developer-friendly Python classes.


Methods

Each layer type has the following methods accessible from its class:

to_json()

Use to_json() to transform the layer class into a Studio JSON layer. If the layer was constructed via a Layer class, it must be transformed to JSON to be applied to the map.

Returns

Returns a dict representing the JSON configuration of the layer.

Example

# Adds the point_layer to the map by transforming it to a JSON
map.add_layer_from_config(point_layer.to_json())

from_json()

Use from_json() to transform Studio JSON layer configuration into the appropriate Python class.

Parameters

ParameterDescription
json (dict)A dictionary containing the JSON configuration for the layer.

Returns

Returns a Python object of the layer class initialized with the provided JSON configuration.

Example

# Transforms a point layer JSON to its corresponding python class
point_layer = map_sdk.PointLayer.from_json(point_layer_json)

clone()

Use clone() to create a deep copy of a layer instance, so that you can quickly make multiple copies that have only small differences between them.

Returns

Returns a Python object of the specified layer.

Example

# Assume layer is a valid Studio Map SDK Python layer object
layer_clone = layer.clone()

Layers

ArcLayer

See Arc Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsUnion[ArcLayerPairsColumns, ArcLayerNeighborsColumns]Required. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents user from editing.
highlight_colorColorHighlight color.
include_legendboolControl if the layer is included in the legend.
opacityfloatOpacity of the layer.
thicknessfloatOutline thickness.
color_rangeColorRangeMapping configuration between color and values.
size_rangeList[float]A range of values that size can take.
target_colorColorTarget color.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

ArcLayerPairsColumns

For pairs of source/target lat/lng columns.

ArgumentData TypeDescription
modeLiteral["points"]Required. Set to "points".
source_latstrRequired. Name of the data column with source latitude data.
source_lngstrRequired. Name of the data column with source longitude data.
target_latstrRequired. Name of the data column with target latitude data.
target_lngstrRequired. Name of the data column with target longitude data.

ArcLayerNeighborsColumns

For a lat/lng with a column containing a neighbor column with lat,lng points.

ArgumentData TypeDescription
modeLiteral["neighbors"]Required. Set to "neighbors".
neighborsstrRequired. Name of the data column with neighbors data.
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

ClusterLayer

See Cluster Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsClusterLayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents user from editing.
include_legendboolControl if the layer is included in the legend.
opacityfloatOpacity of the layer.
cluster_radiusfloatRadius that a cluster will cover.
color_range[ColorRange](#colorrange)Mapping configuration between color and values.
radius_rangeList[float]A range of values that radius can take.
color_aggregationLiteral["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"]The aggregation mode for color.
color_columnstrName of the data column with color data.
color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"]Additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"]The value scale for color values.

ClusterLayerColumns

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

FlowLayer

See Flow Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsUnion[FlowLayerLatLngColumns, FlowLayerH3Columns]Required. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents user from editing.
include_legendboolControl if the layer is included in the legend.
color_rangeColorRangeMapping configuration between color and values.
opacityfloatOpacity of the layer.
flow_animation_enabledboolIs flow animation enabled.
flow_adaptive_scales_enabledboolIs flow adaptive scales enabled.
flow_fade_enabledboolEnable fade effect.
flow_fade_amountfloatFlow fade amount.
max_top_flows_display_numfloatMaximum top flow value.
flow_location_totals_enabledboolAre flow totals enabled.
flow_clustering_enabledboolEnable clustering.
dark_base_map_enabledboolIs dark base map enabled.

FlowLayerLatLngColumns

For pairs of source/target lat/lng columns.

ArgumentData TypeDescription
modeLiteral["points"]Required. Set to "points".
source_latstrRequired. Name of the data column with source latitude data.
source_lngstrRequired. Name of the data column with source longitude data.
target_latstrRequired. Name of the data column with target latitude data.
target_lngstrRequired. Name of the data column with target longitude data.

FlowLayerH3Columns

For datasets with source/target h3 columns.

ArgumentData TypeDescription
modeLiteral["H3"]Required. Set to "H3".
source_h3strRequired. Name of the data column with source H3 cell ID data.
target_h3strRequired. Name of the data column with target H3 cell ID data.
countfloatName of the data column with counts data.
source_namestrName of the data column with source name data.
target_namestrName of the data column with target name data.

GridLayer

See Flow Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsGridLayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents user from editing.
include_legendboolControl if the layer is included in the legend.
opacityfloatOpacity of the layer.
world_unit_sizefloatWorld unit size.
color_rangeColorRangeMapping configuration between color and values.
coveragefloatScaling factor for the geometry (0-1).
size_rangeList[float]A range of values that size can take.
percentileList[float]Percentile amount.
elevation_percentileList[float]Elevation percentile amount.
elevation_scalefloatFactor for scaling the elevation values.
enable_elevation_zoom_factorboolIs elevation zoom factor enabled.
fixed_heightboolUse a fixed height value.
color_aggregationLiteral["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"]The aggregation mode for color.
size_aggregationLiteral["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"]The aggregation mode for size.
enable_3dboolIs 3D mode enabled.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

GridLayerColumns

Lat/lng columns.

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

H3Layer

See H3 Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsH3LayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents editing the layer.
include_legendboolControl if the layer is included in the legend.
text_label List[TextLabelLayer's label information visible on hover.
highlight_colorColorHighlight color.
color_rangeColorRangeMapping configuration between color and values.
filledboolFill the layer.
opacityfloatOpacity of the layer.
outlineboolUse outlines on the layer.
stroke_colorColorStroke color.
stroke_color_rangeColorRangeMapping configuration between stroke color and values.
stroke_opacityfloatStroke opacity of the layer.
thicknessfloatOutline thickness.
coveragefloatScaling factor for the geometry (0-1).
enable_3dboolIs 3D mode enabled.
size_rangeList[float]A range of values that size can take.
coverage_rangeList[float]A range of values that coverage can take.
elevation_scalefloatFactor for scaling the elevation values.
enable_elevation_zoom_factorboolIs elevation zoom factor enabled.
fixed_heightboolUse a fixed height value.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
stroke_color_columnstrName of the data column with stroke color data.
stroke_color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional stroke color column type override.
stroke_color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for stroke color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.
coverage_columnstrName of the data column with coverage data.
coverage_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional coverage column type override.
coverage_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for coverage values.

H3LayerColumns

H3 column.

ArgumentData TypeDescription
hex_idstrRequired. Name of the data column with H3 data.

HeatmapLayer

See Heatmap Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsHeatmapLayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents editing the layer.
include_legendboolControl if the layer is included in the legend.
opacityfloatOpacity of the layer.
intensityfloatValue that is multiplied with the total weight at a pixel to obtain the final weight. Larger values bias the output color towards the higher end of the spectrum, while smaller values bias it towards the lower end.
thresholdfloatA larger threshold smooths the boundaries of color blobs, making pixels with low weight harder to spot.
color_rangeColorRangeMapping configuration between color and values.
radiusfloatRadius of points.
weight_columnstrName of the data column with weight data.
weight_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional weight column type override.
weight_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for weight values.

HeatmapLayerColumns

Lat/lng columns.

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

HexbinLayer

See Hexbin Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsHexbinLayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents editing the layer.
include_legendboolControl if the layer is included in the legend.
opacityfloatOpacity of the layer.
world_unit_sizefloatWorld unit size.
resolutionintBin resolution (0 - 13).
color_rangeColorRangeMapping configuration between color and values.
coveragefloatScaling factor for the geometry (0-1).
size_rangeList[float]A range of values that size can take.
percentileList[float]Percentile amount.
elevation_percentileList[float]Elevation percentile amount.
elevation_scalefloatFactor for scaling the elevation values.
enable_elevation_zoom_factorboolIs elevation zoom factor enabled.
fixed_heightboolUse a fixed height value.
color_aggregationLiteral["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"]The aggregation mode for color.
size_aggregationLiteral["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"]The aggregation mode for size.
enable_3dboolIs 3D mode enabled.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

HexbinLayerColumns

Lat/lng columns.

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

HexTileLayer

See Hexbin Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents editing the layer.
include_legendboolControl if the layer is included in the legend.
tile_urlstrA URL for the tiles.
stroke_colorColorStroke color.
stroke_opacityfloatStroke opacity of the layer.
radiusfloatRadius of points.
enable_3dboolIs 3D mode enabled.
transitionboolControls whether to use transition.
height_rangeList[float]A range of values that height can take.
elevation_scalefloatFactor for scaling the elevation values.
opacityfloatOpacity of the layer.
color_rangeColorRangeMapping configuration between color and values.
radius_by_zoomDict[int, float]Dynamically select radius based on the zoom level.
tile_querystrTile query.
show_outlinesboolShow outlines.
show_pointsboolShow center points.
dynamic_colorboolColor ranges are dynamically calculated and mapped based on the content visible in the viewport.
cell_per_tile_thresholdfloatCells per tile threshold.
use_percentile_rangeboolUse percentile range.
percentile_rangeList[float]Percentile range.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
height_columnstrName of the data column with height data.
height_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional height column type override.
height_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for height values.

IconLayer

See Icon Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsIconLayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel. Prevents editing the layer.
include_legendboolControl if the layer is included in the legend.
highlight_colorColorHighlight color.
radiusfloatRadius of points.
fixed_radiusboolUse a fixed radius value.
opacityfloatOpacity of the layer.
color_rangeColorRangeMapping configuration between color and values.
radius_rangeList[float]A range of values that radius can take.
billboardboolWhether the layer is billboarded.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

IconLayerColumns

Lat/lng columns, as well as an icon data column.

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data
lngstrRequired. Name of the data column with longitude data
iconstrRequired. Name of the data column with icon data
altstrName of the data column with altitude data

LineLayer

See Line Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID
columnsUnion[LineLayerPairsColumns, LineLayerNeighborsColumns]Required. Mapping between data columns and layer properties
idstrLayer ID
labelstrThe displayed layer label
colorColorLayer color
is_visibleboolLayer visibility on the map
hiddenboolHide layer from the layer panel
include_legendboolControl of the layer in the legend
opacityfloatOpacity of the layer
thicknessfloatOutline thickness
color_rangeColorRangeMapping configuration between color and values
size_rangeList[float]A range of values that size can take
target_colorColorTarget color
elevation_scalefloatFactor for scaling the elevation values
target_colorstrName of the data column with color data
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values
size_columnstrName of the data column with size data
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values

LineLayerPairsColumns

For pairs of source/target lat/lng columns.

ArgumentData TypeDescription
modeLiteral["points"]Required. Set to "points".
source_latstrRequired. Name of the data column with source latitude data.
source_lngstrRequired. Name of the data column with source longitude data.
target_latstrRequired. Name of the data column with target latitude data.
target_lngstrRequired. Name of the data column with target longitude data.

LineLayerNeighborsColumns

For a lat/lng with a column containing a neighbor column with lat,lng points.

ArgumentData TypeDescription
modeLiteral["neighbors"]Required. Set to "neighbors".
neighborsstrRequired. Name of the data column with neighbors data.
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.

PointLayer

See Point Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID
columnsUnion[PointLayerGeojsonColumns, PointLayerNeighborsColumns``Required. Mapping between data columns and layer properties
idstrLayer ID
labelstrThe displayed layer label
colorColorLayer color
is_visibleboolLayer visibility on the map
hiddenboolHide layer from the layer panel
include_legendboolControl of the layer in the legend
highlight_colorColorHighlight color
text_labelList[TextLabel]Layer's label information visible on hover
radiusfloatRadius of points
fixed_radiusboolUse a fixed radius value
opacityfloatOpacity of the layer
outlineboolUse outlines on the layer
thicknessfloatOutline thickness
stroke_colorColorStroke color
radius_rangeList[float]A range of values that radius can take
filledboolFill the layer
billboardboolWhether the layer is billboarded
allow_hoverboolControl if hover is allowed
show_neighbor_on_hoverboolShow neighbor on hover
show_highlight_colorboolColor of the hover highlight
color_rangeColorRangeMapping configuration between color and values
stroke_color_rangeColorRangeMapping configuration between stroke color and values
target_colorstrName of the data column with color data
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values
stroke_color_columnstrName of the data column with stroke color data
stroke_color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional stroke color column type override
stroke_color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for stroke color values
size_columnstrName of the data column with size data
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values

PointLayerGeojsonColumns

Geojson columns.

ArgumentData TypeDescription
modeLiteral["geojson"]The mode for the column mapping, default is "geojson"
geojsonstrRequired. Name of the data column with geojson data

PointLayerNeighborsColumns

Lat/lng columns, optionally including a list of columns with neighbor data.

ArgumentData TypeDescription
modeLiteral["points"]The mode for the column mapping, default is "points"
latstrRequired. Name of the data column with latitude data
lngstrRequired. Name of the data column with longitude data
altstrName of the data column with altitude data
neighborsstrName of the data column with neighbors data

PolygonLayer

See Polygon Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID
columnsUnion[PolygonLayerGeojsonColumns, PolygonLayerLatLngColumns]Required. Mapping between data columns and layer properties
idstrLayer ID (use a string without space)
labelstrThe displayed layer label
colorColorLayer color
is_visibleboolLayer visibility on the map
hiddenboolHide layer from the layer panel. This will prevent user from editing the layer
include_legendboolControl of the layer is included in the legend
highlight_colorColorHighlight color
text_labelList[TextLabel]Layer's label information visible on hover
opacityfloatOpacity of the layer
stroke_opacityfloatStroke opacity of the layer
thicknessfloatOutline thickness
stroke_colorColorStroke color
color_rangeColorRangeMapping configuration between color and values
stroke_color_rangeColorRangeMapping configuration between stroke color and values
radiusfloatRadius of points
size_rangeList[float]A range of values that size can take
radius_rangeList[float]A range of values that radius can take
height_rangeList[float]A range of values that height can take
elevation_scalefloatFactor for scaling the elevation values with
strokedboolIs stroke enabled
filledboolFill the layer
enable_3dboolIs 3D mode enabled
wireframeboolIs wireframe enabled
fixed_heightboolUse a fixed height value
target_colorstrName of the data column with color data
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values
stroke_color_columnstrName of the data column with stroke color data
stroke_color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional stroke color column type override
stroke_color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for stroke color values
size_columnstrName of the data column with size data
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values
height_columnstrName of the data column with height data
height_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional height column type override
height_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for height values
radius_columnstrName of the data column with radius data
radius_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional radius column type override
radius_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for radius values

PolygonLayerGeojsonColumns

Geojson columns.

ArgumentData TypeDescription
modeLiteral["geojson"]The mode for the column mapping, default is "geojson"
geojsonstrRequired. Name of the data column with geojson data

PolygonLayerLatLngColumns

Lat/lng columns for the polygon layer. Will produce points rather than shapes.

ArgumentData TypeDescription
idstrRequired. Name of the data column with ID data
latstrRequired. Name of the data column with latitude data
lngstrRequired. Name of the data column with longitude data
altstrName of the data column with altitude data
sort_bystrName of the data column with sort filter data

RasterLayer

See Raster Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrDataset ID. Required.
idstrLayer ID (use a string without spaces).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel to prevent user from editing it.
include_legendboolControl whether the layer is included in the legend.
presetLiteral["trueColor", "infrared", "agriculture", "forestBurn", "ndvi", "savi", "msavi", "ndmi", "nbr", "nbr2", "singleBand"]Raster tile preset.
mosaic_idstrMosaic ID.
use_stac_searchingboolUse STAC searching.
stac_search_providerLiteral["earth-search", "microsoft"]STAC search provider to use.
start_datestrStart date.
end_datestrEnd date.
dynamic_colorboolColor ranges are dynamically calculated based on the viewport content.
color_map_idLiteral["cfastie", "rplumbo", "schwarzwald", "viridis", "plasma", "inferno", "magma", "cividis", "greys", "purples", "blues", "greens", "oranges", "reds", "ylorbr", "ylorrd", "orrd", "purd", "rdpu", "bupu", "gnbu", "pubu", "ylgnbu", "pubugn", "bugn", "ylgn", "binary", "gray", "bone", "pink", "spring", "summer", "autumn", "winter", "cool", "wistia", "hot", "afmhot", "gist_heat", "copper", "piyg", "prgn", "brbg", "puor", "rdgy", "rdbu", "rdylbu", "rdylgn", "spectral", "coolwarm", "bwr", "seismic", "twilight", "twilight_shifted", "hsv", "flag", "prism", "ocean", "gist_earth", "terrain", "gist_stern", "gnuplot", "gnuplot2", "cmrmap", "cubehelix", "brg", "gist_rainbow", "rainbow", "jet", "nipy_spectral", "gist_ncar"]One of the predefined color maps for mappings.
color_rangeColorRangeMapping configuration between color and values.
linear_rescaling_factorList[float]Linear rescaling factor.
non_linear_rescalingboolUse non-linear rescaling.
gamma_contrast_factorfloatGamma contrast factor.
sigmoidal_contrast_factorfloatSigmoidal contrast factor.
sigmoidal_bias_factorfloatSigmoidal bias factor.
saturation_valuefloatSaturation value.
filter_enabledboolEnable filter.
filter_rangeList[float]Filter's range.
opacityfloatOpacity of the layer.
single_band_namestrName of a single band to use.
enable_terrainboolEnable terrain.

S2Layer

See S2 Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsS2LayerColumnsRequired. Mapping between data columns and layer properties.
idstrLayer ID (use a string without spaces).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel to prevent user from editing it.
include_legendboolControl whether the layer is included in the legend.
opacityfloatOpacity of the layer.
color_rangeColorRangeMapping configuration between color and values.
filledboolFill the layer.
thicknessfloatOutline thickness.
stroke_colorColorStroke color.
stroke_color_rangeColorRangeMapping configuration between stroke color and values.
size_rangeList[float]Range of values that size can take.
strokedboolEnable stroke.
enable_3dboolEnable 3D mode.
elevation_scalefloatFactor for scaling elevation values.
enable_elevation_zoom_factorboolEnable elevation zoom factor.
fixed_heightboolUse a fixed height value.
height_rangeList[float]Range of values that height can take.
wireframeboolEnable wireframe.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] Value scale for color values.
stroke_color_columnstrName of the data column with stroke color data.
stroke_color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional stroke color column type override.
stroke_color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] Value scale for stroke color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] Value scale for size values.
height_columnstrName of the data column with height data.
height_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]Additional height column type override.
height_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] Value scale for height values.

S2LayerColumns

A token for S2 columns.

ArgumentData TypeDescription
tokenstrName of the data column with H3 data. Required.

ThreeDLayer

See 3D Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID
columnsThreeDLayerColumnsRequired. Mapping between data columns and layer properties
idstrLayer ID (use a string without space)
labelstrThe displayed layer label
colorColorLayer color
is_visibleboolLayer visibility on the map
hiddenboolHide layer from the layer panel, preventing user from editing the layer
include_legendboolControl if the layer is included in the legend
opacityfloatOpacity of the layer
color_rangeColorRangeMapping configuration between color and values
size_scalefloatA scaling factor
angle_xfloatAdditional X angle offset
angle_yfloatAdditional Y angle offset
angle_zfloatAdditional Z angle offset
model_3dLiteral["airplane", "helicopter", "bicycle", "scooter", "car", "truck", "semitruck", "cargoship", "boeing777", "uber-evtol", "hang-glider"]One of the built-in 3D models to use
model_3d_custom_urlstrURL of a custom 3D model to load and use
model_3d_color_enabledboolColor 3D models used
model_3d_colorColorA fixed color for 3D models
target_colorstrName of the data column with color data
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values
size_columnstrName of the data column with size data
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values

ThreeDLayerColumns

ArgumentData TypeDescription
latstrRequired. Name of the data column with latitude data
lngstrRequired. Name of the data column with longitude data
altstrName of the data column with altitude data

ThreeDTileLayer

See 3D Tile docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID
idstrLayer ID (use a string without space)
labelstrThe displayed layer label
colorColorLayer color
is_visibleboolLayer visibility on the map
hiddenboolHide layer from the layer panel, preventing user from editing the layer
include_legendboolControl if the layer is included in the legend
opacityfloatOpacity of the layer

TripLayer

See Trip Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
columnsUnion[TripLayerGeojsonColumns, TripLayerTimeseriesColumns]Required. Mapping between data columns and layer properties.
idstrLayer ID (use a string without spaces).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel, preventing user from editing it.
include_legendboolControl if the layer is included in the legend.
text_labelList[TextLabel]Layer's label information visible on hover.
opacityfloatOpacity of the layer.
thicknessfloatOutline thickness.
color_rangeColorRangeMapping configuration between color and values.
fade_trailboolMake the trail fade out over time.
fade_trail_durationfloatNumber of seconds for the trail to fade out completely.
billboardboolWhether the layer is billboarded.
size_rangeList[float]A range of values that size can take.
size_scalefloatA scaling factor.
model_3d_enabledboolUse 3D models for visualization.
model_3dLiteral["airplane", "helicopter", "bicycle", "scooter", "car", "truck", "semitruck", "cargoship", "boeing777", "uber-evtol", "hang-glider"]One of the built-in 3D models to use.
model_3d_custom_urlstrURL of a custom 3D model to load and use.
model_3d_color_enabledboolUse color for 3D models.
model_3d_use_trail_colorboolColor 3D models based on trail color.
model_3d_colorColorA fixed color for 3D models.
adjust_rollfloatAn additional offset for roll.
adjust_pitchfloatAn additional offset for pitch.
adjust_yawfloatAn additional offset for yaw.
invert_rollboolInvert the roll angle winding direction.
invert_pitchboolInvert the pitch angle winding direction.
invert_yawboolInvert the yaw angle winding direction.
fixed_rollboolUse a fixed roll value.
fixed_pitchboolUse a fixed pitch value.
fixed_yawboolUse a fixed yaw value.
color_columnstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_columnstrName of the data column with size data.
size_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional size column type override.
size_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.
roll_columnstrName of the data column with roll data.
roll_column_typeLiteral["real", "timestamp", "integer"]An additional roll column type override.
roll_column_scaleLiteral["linear"] The value scale for roll values.
pitch_columnstrName of the data column with pitch data.
pitch_column_typeLiteral["real", "timestamp", "integer"]An additional pitch column type override.
pitch_column_scaleLiteral["linear"] The value scale for pitch values.
yaw_columnstrName of the data column with yaw data.
yaw_column_typeLiteral["real", "timestamp", "integer"]An additional yaw column type override.
yaw_column_scaleLiteral["linear"] The value scale for yaw values.

TripLayerGeojsonColumns

For tables containing GeoJSON columns.

ArgumentData TypeDescription
geojsonstrRequired. Name of the data column with GeoJSON data.

TripLayerTimeseriesColumns

For tables containing and ID, latitude, longitude, and timestamp columns. Optional altitude column.

ArgumentData TypeDescription
idstrRequired. Name of the data column with ID data.
latstrRequired. Name of the data column with latitude data.
lngstrRequired. Name of the data column with longitude data.
timestampstrRequired. Name of the data column with timestamp data.
altstrName of the data column with altitude data.

VectorLayer

See Vector Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel.
include_legendboolControl of the layer in the legend.
tile_urlstrA URL for the tiles.
strokedboolIs stroke enabled.
stroke_colorColorStroke color.
stroke_opacityfloatStroke opacity of the layer.
stroke_widthfloatStroke width.
radiusfloatRadius of points.
enable_3dboolIs 3D mode enabled.
transitionboolControls whether to use transition.
height_rangeList[float]A range of values that height can take.
elevation_scalefloatFactor for scaling the elevation values.
opacityfloatOpacity of the layer.
color_rangeColorRangeMapping configuration between color and values.
stroke_color_rangeColorRangeMapping configuration between stroke color and values.
radius_by_zoomDict[int, float]Dynamically select radius based on the zoom level.
dynamic_colorboolColor ranges are dynamically calculated and mapped based on the visible content.
target_colorstrName of the data column with color data.
color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional color column type override.
color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
stroke_color_columnstrName of the data column with stroke color data.
stroke_color_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional stroke color column type override.
stroke_color_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for stroke color values.
height_columnstrName of the data column with height data.
height_column_typeLiteral["string", "real", "timestamp", "integer", "boolean", "date"]An additional height column type override.
height_column_scaleLiteral["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for height values.

WMSLayer

See WMS Layer docuemntation for more information.

ArgumentData TypeDescription
data_idstrRequired. Dataset ID.
idstrLayer ID (use a string without space).
labelstrThe displayed layer label.
colorColorLayer color.
is_visibleboolLayer visibility on the map.
hiddenboolHide layer from the layer panel.
include_legendboolControl of the layer in the legend.
opacityfloatOpacity of the layer.
service_layersList[str] Percentile range.

Shared Classes

There are a few classes shared amongst several layer types.

Color

RGB representation of color.

ArgumentData TypeDescription
rintRed channel (default is 255).
gintGreen channel (default is 255).
bintBlue channel (default is 255).
aintAlpha channel .

ColorRange

Describes the mapping and the distribution between values and colors.

ArgumentData TypeDescription
typeLiteral["sequential", "qualitative", "diverging", "cyclical", "custom", "ordinal", "customOrdinal"]Type of color range.
namestrName of the color range.
categorystrName of the category for the color range.
colorsList[str] The list of colors (hex values).
reversedboolControls whether to reverse the mappings.
color_mapList[Tuple[Union[Value, ValueRange], str]]Mapping between values (or value ranges) and colors.
color_legendsDict[str, str]Names of the colors displayed in the map legend.

TextLabel

ArgumentData TypeDescription
field_namestrName of the data column to use.
field_typestrOverride for the column data type.
field_formatstrAdditional field formatting.
sizefloatFont size.
colorColorFont color.
backgroundboolIndicates if the label has a background.
background_colorColorBackground color.
outline_widthfloatThe width of the outline.