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? Skip link to 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 Skip link to Example

👀

Rather see it in action? Skip link to Rather see it in action?

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

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

Python


# 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.

(Geojson example)

    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 Skip link to Learn more about these classes

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

Add Layers to the Map Skip link to 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.

Python

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:

Python

# 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 Skip link to 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:

Python

# 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 Skip link to Methods

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

to_json() Skip link to [object Object]

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 Skip link to Returns

Returns a dict representing the JSON configuration of the layer.

Example Skip link to Example

Python

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

from_json() Skip link to [object Object]

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

Parameters Skip link to Parameters

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

Returns Skip link to Returns

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

Example Skip link to Example

Python

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

clone() Skip link to [object Object]

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 Skip link to Returns

Returns a Python object of the specified layer.

Example Skip link to Example

Python

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

Layers Skip link to Layers

ArcLayer Skip link to [object Object]

See Arc Layer documentation for more information.

Argument Data Type Description
data_id str Required. Dataset ID.
columns Union[ ArcLayerPairsColumns, ArcLayerNeighborsColumns] Required. Mapping between data columns and layer properties.
id str Layer ID (use a string without space).
label str The displayed layer label.
color Color Layer color.
is_visible bool Layer visibility on the map.
hidden bool Hide layer from the layer panel. Prevents user from editing.
highlight_color Color Highlight color.
include_legend bool Control if the layer is included in the legend.
opacity float Opacity of the layer.
thickness float Outline thickness.
color_range ColorRange Mapping configuration between color and values.
size_range List[float] A range of values that size can take.
target_color Color Target color.
target_color str Name of the data column with color data.
color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] Additional color column type override.
color_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_column str Name of the data column with size data.
size_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] Additional size column type override.
size_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

ArcLayerPairsColumns Skip link to [object Object]

For pairs of source/target lat/lng columns.

Argument Data Type Description
mode Literal["points"] Required. Set to "points".
source_lat str Required. Name of the data column with source latitude data.
source_lng str Required. Name of the data column with source longitude data.
target_lat str Required. Name of the data column with target latitude data.
target_lng str Required. Name of the data column with target longitude data.

ArcLayerNeighborsColumns Skip link to [object Object]

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

Argument Data Type Description
mode Literal["neighbors"] Required. Set to "neighbors".
neighbors str Required. Name of the data column with neighbors data.
lat str Required. Name of the data column with latitude data.
lng str Required. Name of the data column with longitude data.

ClusterLayer Skip link to [object Object]

See Cluster Layer documentation for more information.

Argument Data Type Description
data_id str Required. Dataset ID.
columns ClusterLayerColumns Required. Mapping between data columns and layer properties.
id str Layer ID (use a string without space).
label str The displayed layer label.
color Color Layer color.
is_visible bool Layer visibility on the map.
hidden bool Hide layer from the layer panel. Prevents user from editing.
include_legend bool Control if the layer is included in the legend.
opacity float Opacity of the layer.
cluster_radius float Radius that a cluster will cover.
color_range [ColorRange](#colorrange) Mapping configuration between color and values.
radius_range List[float] A range of values that radius can take.
color_aggregation Literal["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"] The aggregation mode for color.
color_column str Name of the data column with color data.
color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] Additional color column type override.
color_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.

ClusterLayerColumns Skip link to [object Object]

Argument Data Type Description
lat str Required. Name of the data column with latitude data.
lng str Required. Name of the data column with longitude data.

FlowLayer Skip link to [object Object]

See Flow Layer documentation for more information.

Argument Data Type Description
data_id str Required. Dataset ID.
columns Union[ FlowLayerLatLngColumns, FlowLayerH3Columns] Required. Mapping between data columns and layer properties.
id str Layer ID (use a string without space).
label str The displayed layer label.
color Color Layer color.
is_visible bool Layer visibility on the map.
hidden bool Hide layer from the layer panel. Prevents user from editing.
include_legend bool Control if the layer is included in the legend.
color_range ColorRange Mapping configuration between color and values.
opacity float Opacity of the layer.
flow_animation_enabled bool Is flow animation enabled.
flow_adaptive_scales_enabled bool Is flow adaptive scales enabled.
flow_fade_enabled bool Enable fade effect.
flow_fade_amount float Flow fade amount.
max_top_flows_display_num float Maximum top flow value.
flow_location_totals_enabled bool Are flow totals enabled.
flow_clustering_enabled bool Enable clustering.
dark_base_map_enabled bool Is dark base map enabled.

FlowLayerLatLngColumns Skip link to [object Object]

For pairs of source/target lat/lng columns.

FlowLayerH3Columns Skip link to [object Object]

For datasets with source/target h3 columns.

Argument Data Type Description
mode Literal["H3"] Required. Set to "H3".
source_h3 str Required. Name of the data column with source H3 cell ID data.
target_h3 str Required. Name of the data column with target H3 cell ID data.
count float Name of the data column with counts data.
source_name str Name of the data column with source name data.
target_name str Name of the data column with target name data.

GridLayer Skip link to [object Object]

See Flow Layer documentation for more information.

Argument Data Type Description
data_id str Required. Dataset ID.
columns GridLayerColumns Required. Mapping between data columns and layer properties.
id str Layer ID (use a string without space).
label str The displayed layer label.
color Color Layer color.
is_visible bool Layer visibility on the map.
hidden bool Hide layer from the layer panel. Prevents user from editing.
include_legend bool Control if the layer is included in the legend.
opacity float Opacity of the layer.
world_unit_size float World unit size.
color_range ColorRange Mapping configuration between color and values.
coverage float Scaling factor for the geometry (0-1).
size_range List[float] A range of values that size can take.
percentile List[float] Percentile amount.
elevation_percentile List[float] Elevation percentile amount.
elevation_scale float Factor for scaling the elevation values.
enable_elevation_zoom_factor bool Is elevation zoom factor enabled.
fixed_height bool Use a fixed height value.
color_aggregation Literal["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"] The aggregation mode for color.
size_aggregation Literal["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"] The aggregation mode for size.
enable_3d bool Is 3D mode enabled.
target_color str Name of the data column with color data.
color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional color column type override.
color_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
size_column str Name of the data column with size data.
size_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional size column type override.
size_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.

GridLayerColumns Skip link to [object Object]

Lat/lng columns.

H3Layer Skip link to [object Object]

See H3 Layer documentation for more information.

Argument Data Type Description
data_id str Required. Dataset ID.
columns H3LayerColumns Required. Mapping between data columns and layer properties.
id str Layer ID (use a string without space).
label str The displayed layer label.
color Color Layer color.
is_visible bool Layer visibility on the map.
hidden bool Hide layer from the layer panel. Prevents editing the layer.
include_legend bool Control if the layer is included in the legend.
text_label List[ TextLabel Layer's label information visible on hover.
highlight_color Color Highlight color.
color_range ColorRange Mapping configuration between color and values.
filled bool Fill the layer.
opacity float Opacity of the layer.
outline bool Use outlines on the layer.
stroke_color Color Stroke color.
stroke_color_range ColorRange Mapping configuration between stroke color and values.
stroke_opacity float Stroke opacity of the layer.
thickness float Outline thickness.
coverage float Scaling factor for the geometry (0-1).
enable_3d bool Is 3D mode enabled.
size_range List[float] A range of values that size can take.
coverage_range List[float] A range of values that coverage can take.
elevation_scale float Factor for scaling the elevation values.
enable_elevation_zoom_factor bool Is elevation zoom factor enabled.
fixed_height bool Use a fixed height value.
target_color str Name of the data column with color data.
color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional color column type override.
color_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for color values.
stroke_color_column str Name of the data column with stroke color data.
stroke_color_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional stroke color column type override.
stroke_color_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for stroke color values.
size_column str Name of the data column with size data.
size_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional size column type override.
size_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for size values.
coverage_column str Name of the data column with coverage data.
coverage_column_type Literal["string", "real", "timestamp", "integer", "boolean", "date"] An additional coverage column type override.
coverage_column_scale Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] The value scale for coverage values.
\

H3LayerColumns Skip link to [object Object]\


H3 column.

| Argument | Data Type | Description |
| --- | --- | --- |
| hex_id | str | Required. Name of the data column with H3 data. |
\

HeatmapLayer Skip link to [object Object]\


See Heatmap Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| columns | HeatmapLayerColumns | Required. Mapping between data columns and layer properties. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. Prevents editing the layer. |
| include_legend | bool | Control if the layer is included in the legend. |
| opacity | float | Opacity of the layer. |
| intensity | float | Value 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. |
| threshold | float | A larger threshold smooths the boundaries of color blobs, making pixels with low weight harder to spot. |
| color_range | ColorRange | Mapping configuration between color and values. |
| radius | float | Radius of points. |
| weight_column | str | Name of the data column with weight data. |
| weight_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional weight column type override. |
| weight_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for weight values. |
\

HeatmapLayerColumns Skip link to [object Object]\


Lat/lng columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| lat | str | Required. Name of the data column with latitude data. |
| lng | str | Required. Name of the data column with longitude data. |
\

HexbinLayer Skip link to [object Object]\


See Hexbin Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| columns | HexbinLayerColumns | Required. Mapping between data columns and layer properties. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. Prevents editing the layer. |
| include_legend | bool | Control if the layer is included in the legend. |
| opacity | float | Opacity of the layer. |
| world_unit_size | float | World unit size. |
| resolution | int | Bin resolution (0 - 13). |
| color_range | ColorRange | Mapping configuration between color and values. |
| coverage | float | Scaling factor for the geometry (0-1). |
| size_range | List[float] | A range of values that size can take. |
| percentile | List[float] | Percentile amount. |
| elevation_percentile | List[float] | Elevation percentile amount. |
| elevation_scale | float | Factor for scaling the elevation values. |
| enable_elevation_zoom_factor | bool | Is elevation zoom factor enabled. |
| fixed_height | bool | Use a fixed height value. |
| color_aggregation | Literal["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"] | The aggregation mode for color. |
| size_aggregation | Literal["count", "average", "maximum", "minimum", "median", "stdev", "sum", "variance", "mode", "countUnique"] | The aggregation mode for size. |
| enable_3d | bool | Is 3D mode enabled. |
| target_color | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values. |
| size_column | str | Name of the data column with size data. |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override. |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values. |
\

HexbinLayerColumns Skip link to [object Object]\


Lat/lng columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| lat | str | Required. Name of the data column with latitude data. |
| lng | str | Required. Name of the data column with longitude data. |
\

HexTileLayer Skip link to [object Object]\


See Hexbin Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. Prevents editing the layer. |
| include_legend | bool | Control if the layer is included in the legend. |
| tile_url | str | A URL for the tiles. |
| stroke_color | Color | Stroke color. |
| stroke_opacity | float | Stroke opacity of the layer. |
| radius | float | Radius of points. |
| enable_3d | bool | Is 3D mode enabled. |
| transition | bool | Controls whether to use transition. |
| height_range | List[float] | A range of values that height can take. |
| elevation_scale | float | Factor for scaling the elevation values. |
| opacity | float | Opacity of the layer. |
| color_range | ColorRange | Mapping configuration between color and values. |
| radius_by_zoom | Dict[int, float] | Dynamically select radius based on the zoom level. |
| tile_query | str | Tile query. |
| show_outlines | bool | Show outlines. |
| show_points | bool | Show center points. |
| dynamic_color | bool | Color ranges are dynamically calculated and mapped based on the content visible in the viewport. |
| cell_per_tile_threshold | float | Cells per tile threshold. |
| use_percentile_range | bool | Use percentile range. |
| percentile_range | List[float] | Percentile range. |
| target_color | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values. |
| height_column | str | Name of the data column with height data. |
| height_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional height column type override. |
| height_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for height values. |
\

IconLayer Skip link to [object Object]\


See Icon Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| columns | IconLayerColumns | Required. Mapping between data columns and layer properties. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. Prevents editing the layer. |
| include_legend | bool | Control if the layer is included in the legend. |
| highlight_color | Color | Highlight color. |
| radius | float | Radius of points. |
| fixed_radius | bool | Use a fixed radius value. |
| opacity | float | Opacity of the layer. |
| color_range | ColorRange | Mapping configuration between color and values. |
| radius_range | List[float] | A range of values that radius can take. |
| billboard | bool | Whether the layer is billboarded. |
| target_color | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values. |
| size_column | str | Name of the data column with size data. |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override. |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values. |
\

IconLayerColumns Skip link to IconLayerColumns\


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

| Argument | Data Type | Description |
| --- | --- | --- |
| lat | str | Required. Name of the data column with latitude data |
| lng | str | Required. Name of the data column with longitude data |
| icon | str | Required. Name of the data column with icon data |
| alt | str | Name of the data column with altitude data |
\

LineLayer Skip link to [object Object]\


See Line Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID |
| columns | Union[ LineLayerPairsColumns, LineLayerNeighborsColumns] | Required. Mapping between data columns and layer properties |
| id | str | Layer ID |
| label | str | The displayed layer label |
| color | Color | Layer color |
| is_visible | bool | Layer visibility on the map |
| hidden | bool | Hide layer from the layer panel |
| include_legend | bool | Control of the layer in the legend |
| opacity | float | Opacity of the layer |
| thickness | float | Outline thickness |
| color_range | ColorRange | Mapping configuration between color and values |
| size_range | List[float] | A range of values that size can take |
| target_color | Color | Target color |
| elevation_scale | float | Factor for scaling the elevation values |
| target_color | str | Name of the data column with color data |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values |
| size_column | str | Name of the data column with size data |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values |
\

LineLayerPairsColumns Skip link to [object Object]\


For pairs of source/target lat/lng columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| mode | Literal["points"] | Required. Set to "points". |
| source_lat | str | Required. Name of the data column with source latitude data. |
| source_lng | str | Required. Name of the data column with source longitude data. |
| target_lat | str | Required. Name of the data column with target latitude data. |
| target_lng | str | Required. Name of the data column with target longitude data. |
\

LineLayerNeighborsColumns Skip link to [object Object]\


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

| Argument | Data Type | Description |
| --- | --- | --- |
| mode | Literal["neighbors"] | Required. Set to "neighbors". |
| neighbors | str | Required. Name of the data column with neighbors data. |
| lat | str | Required. Name of the data column with latitude data. |
| lng | str | Required. Name of the data column with longitude data. |
\

PointLayer Skip link to [object Object]\


See Point Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID |
| columns | Union[ PointLayerGeojsonColumns, PointLayerNeighborsColumns `` | Required. Mapping between data columns and layer properties |
| id | str | Layer ID |
| label | str | The displayed layer label |
| color | Color | Layer color |
| is_visible | bool | Layer visibility on the map |
| hidden | bool | Hide layer from the layer panel |
| include_legend | bool | Control of the layer in the legend |
| highlight_color | Color | Highlight color |
| text_label | List[ TextLabel] | Layer's label information visible on hover |
| radius | float | Radius of points |
| fixed_radius | bool | Use a fixed radius value |
| opacity | float | Opacity of the layer |
| outline | bool | Use outlines on the layer |
| thickness | float | Outline thickness |
| stroke_color | Color | Stroke color |
| radius_range | List[float] | A range of values that radius can take |
| filled | bool | Fill the layer |
| billboard | bool | Whether the layer is billboarded |
| allow_hover | bool | Control if hover is allowed |
| show_neighbor_on_hover | bool | Show neighbor on hover |
| show_highlight_color | bool | Color of the hover highlight |
| color_range | ColorRange | Mapping configuration between color and values |
| stroke_color_range | ColorRange | Mapping configuration between stroke color and values |
| target_color | str | Name of the data column with color data |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values |
| stroke_color_column | str | Name of the data column with stroke color data |
| stroke_color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional stroke color column type override |
| stroke_color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for stroke color values |
| size_column | str | Name of the data column with size data |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values |
\

PointLayerGeojsonColumns Skip link to [object Object]\


Geojson columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| mode | Literal["geojson"] | The mode for the column mapping, default is "geojson" |
| geojson | str | Required. Name of the data column with geojson data |
\

PointLayerNeighborsColumns Skip link to [object Object]\


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

| Argument | Data Type | Description |
| --- | --- | --- |
| mode | Literal["points"] | The mode for the column mapping, default is "points" |
| lat | str | Required. Name of the data column with latitude data |
| lng | str | Required. Name of the data column with longitude data |
| alt | str | Name of the data column with altitude data |
| neighbors | str | Name of the data column with neighbors data |
\

PolygonLayer Skip link to [object Object]\


See Polygon Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID |
| columns | Union[ PolygonLayerGeojsonColumns, PolygonLayerLatLngColumns] | Required. Mapping between data columns and layer properties |
| id | str | Layer ID (use a string without space) |
| label | str | The displayed layer label |
| color | Color | Layer color |
| is_visible | bool | Layer visibility on the map |
| hidden | bool | Hide layer from the layer panel. This will prevent user from editing the layer |
| include_legend | bool | Control of the layer is included in the legend |
| highlight_color | Color | Highlight color |
| text_label | List[ TextLabel] | Layer's label information visible on hover |
| opacity | float | Opacity of the layer |
| stroke_opacity | float | Stroke opacity of the layer |
| thickness | float | Outline thickness |
| stroke_color | Color | Stroke color |
| color_range | ColorRange | Mapping configuration between color and values |
| stroke_color_range | ColorRange | Mapping configuration between stroke color and values |
| radius | float | Radius of points |
| size_range | List[float] | A range of values that size can take |
| radius_range | List[float] | A range of values that radius can take |
| height_range | List[float] | A range of values that height can take |
| elevation_scale | float | Factor for scaling the elevation values with |
| stroked | bool | Is stroke enabled |
| filled | bool | Fill the layer |
| enable_3d | bool | Is 3D mode enabled |
| wireframe | bool | Is wireframe enabled |
| fixed_height | bool | Use a fixed height value |
| target_color | str | Name of the data column with color data |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values |
| stroke_color_column | str | Name of the data column with stroke color data |
| stroke_color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional stroke color column type override |
| stroke_color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for stroke color values |
| size_column | str | Name of the data column with size data |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values |
| height_column | str | Name of the data column with height data |
| height_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional height column type override |
| height_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for height values |
| radius_column | str | Name of the data column with radius data |
| radius_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional radius column type override |
| radius_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for radius values |
\

PolygonLayerGeojsonColumns Skip link to [object Object]\


Geojson columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| mode | Literal["geojson"] | The mode for the column mapping, default is "geojson" |
| geojson | str | Required. Name of the data column with geojson data |
\

PolygonLayerLatLngColumns Skip link to [object Object]\


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

| Argument | Data Type | Description |
| --- | --- | --- |
| id | str | Required. Name of the data column with ID data |
| lat | str | Required. Name of the data column with latitude data |
| lng | str | Required. Name of the data column with longitude data |
| alt | str | Name of the data column with altitude data |
| sort_by | str | Name of the data column with sort filter data |
\

RasterLayer Skip link to [object Object]\


See Raster Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Dataset ID. Required. |
| id | str | Layer ID (use a string without spaces). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel to prevent user from editing it. |
| include_legend | bool | Control whether the layer is included in the legend. |
| preset | Literal["trueColor", "infrared", "agriculture", "forestBurn", "ndvi", "savi", "msavi", "ndmi", "nbr", "nbr2", "singleBand"] | Raster tile preset. |
| mosaic_id | str | Mosaic ID. |
| use_stac_searching | bool | Use STAC searching. |
| stac_search_provider | Literal["earth-search", "microsoft"] | STAC search provider to use. |
| start_date | str | Start date. |
| end_date | str | End date. |
| dynamic_color | bool | Color ranges are dynamically calculated based on the viewport content. |
| color_map_id | Literal["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_range | ColorRange | Mapping configuration between color and values. |
| linear_rescaling_factor | List[float] | Linear rescaling factor. |
| non_linear_rescaling | bool | Use non-linear rescaling. |
| gamma_contrast_factor | float | Gamma contrast factor. |
| sigmoidal_contrast_factor | float | Sigmoidal contrast factor. |
| sigmoidal_bias_factor | float | Sigmoidal bias factor. |
| saturation_value | float | Saturation value. |
| filter_enabled | bool | Enable filter. |
| filter_range | List[float] | Filter's range. |
| opacity | float | Opacity of the layer. |
| single_band_name | str | Name of a single band to use. |
| enable_terrain | bool | Enable terrain. |
\

S2Layer Skip link to [object Object]\


See S2 Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| columns | S2LayerColumns | Required. Mapping between data columns and layer properties. |
| id | str | Layer ID (use a string without spaces). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel to prevent user from editing it. |
| include_legend | bool | Control whether the layer is included in the legend. |
| opacity | float | Opacity of the layer. |
| color_range | ColorRange | Mapping configuration between color and values. |
| filled | bool | Fill the layer. |
| thickness | float | Outline thickness. |
| stroke_color | Color | Stroke color. |
| stroke_color_range | ColorRange | Mapping configuration between stroke color and values. |
| size_range | List[float] | Range of values that size can take. |
| stroked | bool | Enable stroke. |
| enable_3d | bool | Enable 3D mode. |
| elevation_scale | float | Factor for scaling elevation values. |
| enable_elevation_zoom_factor | bool | Enable elevation zoom factor. |
| fixed_height | bool | Use a fixed height value. |
| height_range | List[float] | Range of values that height can take. |
| wireframe | bool | Enable wireframe. |
| target_color | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | Additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | Value scale for color values. |
| stroke_color_column | str | Name of the data column with stroke color data. |
| stroke_color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | Additional stroke color column type override. |
| stroke_color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | Value scale for stroke color values. |
| size_column | str | Name of the data column with size data. |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | Additional size column type override. |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | Value scale for size values. |
| height_column | str | Name of the data column with height data. |
| height_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | Additional height column type override. |
| height_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | Value scale for height values. |
\

S2LayerColumns Skip link to [object Object]\


A token for S2 columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| token | str | Name of the data column with H3 data. Required. |
\

ThreeDLayer Skip link to [object Object]\


See 3D Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID |
| columns | ThreeDLayerColumns | Required. Mapping between data columns and layer properties |
| id | str | Layer ID (use a string without space) |
| label | str | The displayed layer label |
| color | Color | Layer color |
| is_visible | bool | Layer visibility on the map |
| hidden | bool | Hide layer from the layer panel, preventing user from editing the layer |
| include_legend | bool | Control if the layer is included in the legend |
| opacity | float | Opacity of the layer |
| color_range | ColorRange | Mapping configuration between color and values |
| size_scale | float | A scaling factor |
| angle_x | float | Additional X angle offset |
| angle_y | float | Additional Y angle offset |
| angle_z | float | Additional Z angle offset |
| model_3d | Literal["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_url | str | URL of a custom 3D model to load and use |
| model_3d_color_enabled | bool | Color 3D models used |
| model_3d_color | Color | A fixed color for 3D models |
| target_color | str | Name of the data column with color data |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values |
| size_column | str | Name of the data column with size data |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values |
\

ThreeDLayerColumns Skip link to [object Object]\


| Argument | Data Type | Description |
| --- | --- | --- |
| lat | str | Required. Name of the data column with latitude data |
| lng | str | Required. Name of the data column with longitude data |
| alt | str | Name of the data column with altitude data |
\

ThreeDTileLayer Skip link to [object Object]\


See 3D Tile documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID |
| id | str | Layer ID (use a string without space) |
| label | str | The displayed layer label |
| color | Color | Layer color |
| is_visible | bool | Layer visibility on the map |
| hidden | bool | Hide layer from the layer panel, preventing user from editing the layer |
| include_legend | bool | Control if the layer is included in the legend |
| opacity | float | Opacity of the layer |
\

TripLayer Skip link to [object Object]\


See Trip Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| columns | Union[ TripLayerGeojsonColumns, TripLayerTimeseriesColumns] | Required. Mapping between data columns and layer properties. |
| id | str | Layer ID (use a string without spaces). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel, preventing user from editing it. |
| include_legend | bool | Control if the layer is included in the legend. |
| text_label | List[ TextLabel] | Layer's label information visible on hover. |
| opacity | float | Opacity of the layer. |
| thickness | float | Outline thickness. |
| color_range | ColorRange | Mapping configuration between color and values. |
| fade_trail | bool | Make the trail fade out over time. |
| fade_trail_duration | float | Number of seconds for the trail to fade out completely. |
| billboard | bool | Whether the layer is billboarded. |
| size_range | List[float] | A range of values that size can take. |
| size_scale | float | A scaling factor. |
| model_3d_enabled | bool | Use 3D models for visualization. |
| model_3d | Literal["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_url | str | URL of a custom 3D model to load and use. |
| model_3d_color_enabled | bool | Use color for 3D models. |
| model_3d_use_trail_color | bool | Color 3D models based on trail color. |
| model_3d_color | Color | A fixed color for 3D models. |
| adjust_roll | float | An additional offset for roll. |
| adjust_pitch | float | An additional offset for pitch. |
| adjust_yaw | float | An additional offset for yaw. |
| invert_roll | bool | Invert the roll angle winding direction. |
| invert_pitch | bool | Invert the pitch angle winding direction. |
| invert_yaw | bool | Invert the yaw angle winding direction. |
| fixed_roll | bool | Use a fixed roll value. |
| fixed_pitch | bool | Use a fixed pitch value. |
| fixed_yaw | bool | Use a fixed yaw value. |
| color_column | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values. |
| size_column | str | Name of the data column with size data. |
| size_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional size column type override. |
| size_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for size values. |
| roll_column | str | Name of the data column with roll data. |
| roll_column_type | Literal["real", "timestamp", "integer"] | An additional roll column type override. |
| roll_column_scale | Literal["linear"] | The value scale for roll values. |
| pitch_column | str | Name of the data column with pitch data. |
| pitch_column_type | Literal["real", "timestamp", "integer"] | An additional pitch column type override. |
| pitch_column_scale | Literal["linear"] | The value scale for pitch values. |
| yaw_column | str | Name of the data column with yaw data. |
| yaw_column_type | Literal["real", "timestamp", "integer"] | An additional yaw column type override. |
| yaw_column_scale | Literal["linear"] | The value scale for yaw values. |
\

TripLayerGeojsonColumns Skip link to [object Object]\


For tables containing GeoJSON columns.

| Argument | Data Type | Description |
| --- | --- | --- |
| geojson | str | Required. Name of the data column with GeoJSON data. |
\

TripLayerTimeseriesColumns Skip link to [object Object]\


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

| Argument | Data Type | Description |
| --- | --- | --- |
| id | str | Required. Name of the data column with ID data. |
| lat | str | Required. Name of the data column with latitude data. |
| lng | str | Required. Name of the data column with longitude data. |
| timestamp | str | Required. Name of the data column with timestamp data. |
| alt | str | Name of the data column with altitude data. |
\

VectorLayer Skip link to [object Object]\


See Vector Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. |
| include_legend | bool | Control of the layer in the legend. |
| tile_url | str | A URL for the tiles. |
| stroked | bool | Is stroke enabled. |
| stroke_color | Color | Stroke color. |
| stroke_opacity | float | Stroke opacity of the layer. |
| stroke_width | float | Stroke width. |
| radius | float | Radius of points. |
| enable_3d | bool | Is 3D mode enabled. |
| transition | bool | Controls whether to use transition. |
| height_range | List[float] | A range of values that height can take. |
| elevation_scale | float | Factor for scaling the elevation values. |
| opacity | float | Opacity of the layer. |
| color_range | ColorRange | Mapping configuration between color and values. |
| stroke_color_range | ColorRange | Mapping configuration between stroke color and values. |
| radius_by_zoom | Dict[int, float] | Dynamically select radius based on the zoom level. |
| dynamic_color | bool | Color ranges are dynamically calculated and mapped based on the visible content. |
| target_color | str | Name of the data column with color data. |
| color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional color column type override. |
| color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for color values. |
| stroke_color_column | str | Name of the data column with stroke color data. |
| stroke_color_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional stroke color column type override. |
| stroke_color_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for stroke color values. |
| height_column | str | Name of the data column with height data. |
| height_column_type | Literal["string", "real", "timestamp", "integer", "boolean", "date"] | An additional height column type override. |
| height_column_scale | Literal["ordinal", "quantize", "quantile", "jenks", "custom", "customOrdinal"] | The value scale for height values. |
\

WMSLayer Skip link to [object Object]\


See WMS Layer documentation for more information.

| Argument | Data Type | Description |
| --- | --- | --- |
| data_id | str | Required. Dataset ID. |
| id | str | Layer ID (use a string without space). |
| label | str | The displayed layer label. |
| color | Color | Layer color. |
| is_visible | bool | Layer visibility on the map. |
| hidden | bool | Hide layer from the layer panel. |
| include_legend | bool | Control of the layer in the legend. |
| opacity | float | Opacity of the layer. |
| service_layers | List[str] | Percentile range. |
\

Shared Classes Skip link to Shared Classes\


There are a few classes shared amongst several layer types.
\

Color Skip link to [object Object]\


RGB representation of color.

| Argument | Data Type | Description |
| --- | --- | --- |
| r | int | Red channel (default is 255). |
| g | int | Green channel (default is 255). |
| b | int | Blue channel (default is 255). |
| a | int | Alpha channel . |
\

ColorRange Skip link to [object Object]\


Describes the mapping and the distribution between values and colors.

| Argument | Data Type | Description |
| --- | --- | --- |
| type | Literal["sequential", "qualitative", "diverging", "cyclical", "custom", "ordinal", "customOrdinal"] | Type of color range. |
| name | str | Name of the color range. |
| category | str | Name of the category for the color range. |
| colors | List[str] | The list of colors (hex values). |
| reversed | bool | Controls whether to reverse the mappings. |
| color_map | List[Tuple[Union[Value, ValueRange], str]] | Mapping between values (or value ranges) and colors. |
| color_legends | Dict[str, str] | Names of the colors displayed in the map legend. |
\

TextLabel Skip link to [object Object]\


| Argument | Data Type | Description |
| --- | --- | --- |
| field_name | str | Name of the data column to use. |
| field_type | str | Override for the column data type. |
| field_format | str | Additional field formatting. |
| size | float | Font size. |
| color | Color | Font color. |
| background | bool | Indicates if the label has a background. |
| background_color | Color | Background color. |
| outline_width | float | The width of the outline. |

Updated5 months ago
\