API Overview

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

The Studio 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.


🎉 v1.0 Update 🎉

Foursquare has released version 1.0 of the Map SDK. This version is a complete rewrite, overhauling the existing Map SDK framework. While we still support Map SDK v0.X, we strongly recommend new and existing users transition to Map SDK v1.0.


Dataset Functions

For a brief description and easy-to-follow examples, please visit the Data Functions page.

API FunctionDescription
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.

Filter Functions

For a brief description and easy-to-follow examples, please visit the Filter Functions page.

API FunctionDescription
addFilter()Adds a filter to the map.
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

For a brief description and easy-to-follow examples, please visit the Layer Functions page.

API FunctionDescription
addLayer()Adds a new layer to the map.
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

For a brief description and easy-to-follow examples, please visit the Map Functions page.

API FunctionDescription
addToDOM()Adds a map into a container element provided as an argument. (Normally called in constructor.)
addEffect()Adds a visual post-processing effect to the map.
createMap()Create a new map instance.
getEffects()Get all visual effects applied to the map.
getEffectById()Get a visual effect by its ID.
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.
setMapConfigLoads 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.
removeEffect()Remove a visual effect from the map.
updateEffect()Update a visual effect on the map.

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.