SDK Reference

The Map SDK provides a range of functions for embedding, controlling, querying and monitoring Studio maps embedded in web pages or Jupyter Notebooks.

The Map SDK API is summarized here. Note that each function is documented on a dedicated page that provides detailed information, including JavaScript and Python syntax, as well as sample code snippets.

Annotation Functions

Functions related to annotations, which are labeled callouts applied to custom positions on your map, and can optionally feature a pointer/line. For a brief description and easy-to-follow examples, please visit the Annotation Functions page.

API Function Description
addAnnotation Adds a new annotation to the map.
getAnnotations Gets all the annotations currently available in the map.
getAnnotationById Retrieves an annotation by its identifier.
removeAnnotation Removes an annotation from the map.
updateAnnotation Updates an existing annotation with given values.

Dataset Functions

Functions related to managing datasets associated with your maps. For a brief description and easy-to-follow examples, please visit the Data Functions page.

API Function Description
addDataset Adds a new dataset to the map.
addTileDataset Adds a new tiled dataset to the map.
getDatasetById Retrieves a dataset by its identifier.
getDatasetWithData Retrieves a dataset record with its data for a given dataset.
getDatasets Gets all datasets available on the map.
removeDataset Removes a dataset from the map.
replaceDataset Replaces a given dataset with a new one.
updateDataset Updates an existing dataset with given values.

Effect Functions

Functions for managing visual post-processing effects.

API Function Description
addEffect Adds a visual effect to the map.
getEffects Get all visual effects applied to the map.
getEffectById Get a visual effect by its ID.
removeEffect Remove a visual effect from the map.
updateEffect Update a visual effect on the map.

Filter Functions

Functions for data filters applied to your map, including timeline filters for temporal, animated maps. For a brief description and easy-to-follow examples, please visit the Filter Functions page.

API Function Description
addFilter Adds a filter to the map.
addFilterFromConfig Adds a new filter from a filter config.
getFilterById Retrieves a filter by its identifier.
getFilters Gets all the filters currently applied to the map.
removeFilter Removes a filter from the map.
updateFilter Updates an existing filter with given values.
updateTimeline Updates a time range filter timeline with given values.

Layer Functions

Functions for managing visual layers and layer groups. For a brief description and easy-to-follow examples, please visit the Layer Functions page.

API Function Description
addLayer Adds a new layer to the map.
addLayerFromConfig Creates a new layer from a layer config.
addLayerGroup Adds a new layer group to the map.
getLayerById Retrieves a layer by its identifier.
getLayerGroupById Retrieves a layer group by its identifier.
getLayerGroups Gets all the layer groups currently available in the map.
getLayers Gets all the layers currently available in the map.
getLayerTimeline Gets the current layer timeline configuration.
removeLayer Removes a layer from the map.
removeLayerGroup Removes a layer group from the map.
updateLayer Updates an existing layer with given values.
updateLayerGroup Updates an existing layer group with given values.
updateLayerTimeline Updates the current layer timeline configuration.

Map Functions

Functions for managing the map's state, including view modes, limits, themes, as well as visual effects. For a brief description and easy-to-follow examples, please visit the Map Functions page.

API Function Description
addToDOM Adds a map into a container element provided as an argument. (Normally called in constructor.)
createMap Create a new map instance.
getMapConfig Gets the configuration representing the current map state.
getMapControlVisibility Gets the map control visibility settings.
getMapStyles Gets the currently available map styles.
getSplitMode Gets the split mode of the map.
getView Gets the current view state of the map.
getViewLimits Gets the current view limits of the map.
getViewMode Gets the current view mode of the map. View mode can be one of "2d", "3d", or "globe".
remove_event_handlers Python-exclusive. Remove an event handler from the map.
set_event_handlers Python-exclusive. Add an event handler to the map.
setMapConfig Loads the given configuration into the current map.
setMapControlVisibility Sets the map control visibility settings.
setSplitMode Sets the split mode of the map.
setTheme Sets the theme of the map.
setView Sets the view state of the map.
setViewLimits Sets the view limits of the map.
setViewMode Sets the view mode of the map to either "2d", "3d", or "globe".
setViewFromConfig Sets the view from the view config.
setAnimationFromConfig Sets the animation from the config.

Tooltip Functions

Functions related to tooltip, a visual temporary pop-up that appears when a user hovers over a specific point on a map. It provides additional contextual information about that point, such as data values of selected columns from dataset.

API Function Description
setTooltipConfig Accepts the configuration as a parameter and modifies the tooltip based on it.

Types

Types are supplied as arguments in many SDK functions. These types are documented on a separate page.

Event Handlers

Applications can add interactivity by listening to events from Studio's maps and implementing custom event handling functions.