API Reference

Annotation Functions Skip link to Annotation Functions


addAnnotation Skip link to addAnnotation

Adds a new annotation to the map.

📝

Note: Skip link to Note:

You can only add one annotation at most.

Python: add_annotation

JavaScriptPython

addAnnotation: (
  annotation: Partial<Annotation>
) => Annotation;
def add_annotation(
    self, annotation: Union[AnnotationCreationProps, dict]
) -> Optional[Annotation]

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
[annotation] Annotation The annotation to add to the map.

Returns Skip link to Returns

Widget map only.

Returns the Annotation object that was added to the map.

Python Skip link to Python

Arguments Skip link to Arguments

Argument Type Description
[annotation] Annotation, dict The annotation to add to the map.

Returns Skip link to Returns

Returns the Annotation object that was added to the map.

Examples Skip link to Examples

JavaScriptPython

map.addAnnotation({
  id: "annotation-1",
  kind: "POINT",
  isVisible: true,
  autoSize: true,
  autoSizeY: true,
  anchorPoint: [-69.30788156774667, -7.1582370789647],
  label: "Annotation 1",
  lineColor: "#C32899",
  lineWidth: 5,
  textWidth: 82.1796875,
  textHeight: 29,
  textVerticalAlign: "bottom",
  armLength: 50,
  angle: -45,
})
map.add_annotation(
    AnnotationCreationProps(
        id="ann_1",
        kind="POINT",
        is_visible=True,
        auto_size=True,
        auto_size_y=True,
        anchor_point=(-69.30788156774667, -7.1582370789647),
        label="Annotation 45",
        line_color="#C32899",
        line_width=5,
        text_width=82.1796875,
        text_height=29,
        text_vertical_align="bottom",
        arm_length=50,
        angle=-45,
    )
)

getAnnotations Skip link to getAnnotations

Gets all annotations on the map.

Python: get_annotations

JavaScriptPython

getAnnotations: () => Annotation[];
 def get_annotations(self) -> List[Annotation]:

Returns Skip link to Returns

Returns a list of the Annotations on the map.

Examples Skip link to Examples

JavaScriptPython

map.getAnnotations();
map.get_annotations()

getAnnotationById Skip link to getAnnotationById

Gets an annotation by providing its ID.

Python: get_annotation_by_id

JavaScriptPython

getAnnotationById: (annotationId: string) => Annotation | null;
def get_annotation_by_id(self, annotation_id: str) -> Optional[Annotation]:

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
annotationId string The ID of the annotation to retrieve.

Returns Skip link to Returns

Returns the Annotation object that was added to the map.

Python Skip link to Python

Arguments Skip link to Arguments

Argument Type Description
annotation_id str The ID of the annotation to retrieve.

Returns Skip link to Returns

Returns the Annotation object that was added to the map.

Examples Skip link to Examples

JavaScriptPython

map.getAnnotationById("annotation-1");
map.get_annotation_by_id("annotation-1")

removeAnnotation Skip link to removeAnnotation

Removes an annotation from the map.

Python: remove_annotation

JavaScriptPython

removeAnnotation: (annotationId: string) => void;
def remove_annotation(self, annotation_id: str) -> None:

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
annotationId string The ID of the annotation to remove.

Python Skip link to Python

Arguments Skip link to Arguments

Argument Type Description
annotation_id str The ID of the annotation to remove.

Examples Skip link to Examples

JavaScriptPython

map.removeAnnotation("annotation-1");
map.remove_annotation("annotation-1")

updateAnnotation Skip link to updateAnnotation

Updates an annotation on the map.

JavaScriptPython

updateAnnotation: (
  annotationId: string,
  values: AnnotationUpdateProps
) => Annotation;
def update_annotation(
    self,
    annotation_id: str,
    values: Union[AnnotationUpdateProps, dict],
) -> Optional[Annotation]

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
annotationId string The ID of the annotation to remove.
values Partial< Annotation> A partial annotation object to pass as an update the specified annotation.

Returns Skip link to Returns

Returns the Annotation object that was added to the map.

Python Skip link to Python

Arguments Skip link to Arguments

Argument Type Description
annotation_id str The ID of the annotation to remove.
values Annotation, dict A partial annotation object, or a dict, to pass as an update the specified annotation.

Returns Skip link to Returns

Returns the Annotation object that was added to the map.

Examples Skip link to Examples

JavaScriptPython

map.updateAnnotation("annotation-1", {
  label: "A new label",
  lineColor: "#FF0000",
})
map.update_annotation("annotation-1", AnnotationUpdateProps(
  label="A new label",
  line_color="#FF0000",
))

Dataset Functions Skip link to Dataset Functions


addDataset Skip link to addDataset

Python: add_dataset

Add a local tabular or tiled dataset object to the map.

JavaScriptPython

addDataset(
  dataset: DatasetCreationProps,
  options?: AddDatasetOptions
): Dataset;
def add_dataset(
    self,
    dataset: Union[\
        LocalDatasetCreationProps,\
        RasterTileDatasetCreationProps,\
        VectorTileDatasetCreationProps,\
        Dict,\
    ],
    *,
    auto_create_layers: bool = True,
    center_map: bool = True,
) -> Optional[Dataset]

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
dataset DatasetCreationProps Data used to create a dataset, in CSV, JSON, GeoJSON format (for local datasets), or a UUID string.
options AddDatasetOptions Options applicable when adding a new dataset.

Returns Skip link to Returns

Returns the Dataset object that was added to the map.

Python Skip link to Python

Positional Arguments Skip link to Positional Arguments

Argument Type Description
dataset Union[ Dataset, Dict, None] Data used to create a dataset, in CSV, JSON, or GeoJSON format (for local datasets) or a UUID string.

Keyword Arguments Skip link to Keyword Arguments

Argument Type Description
auto_create_layers bool Whether to attempt to create new layers when adding a dataset. Defaults to True.
center_map bool Whether to center the map on the created dataset. Defaults to True.
id str Unique identifier of the dataset. If not provided, a random id will be generated.
label str Displayable dataset label.
color Tuple[float, float, float] Color label of the dataset.
metadata dict Object containing tileset metadata (for tiled datasets).

Returns Skip link to Returns

Returns the Dataset object that was added to the map.

Examples Skip link to Examples

JavaScriptPython

// Assume dataset is a valid dataset

map.addDataset({
  id: "test-dataset-01",
  label: "Cities",
  color: [245, 166, 35],
  data: datasetData
},
{
  autoCreateLayers: true,
  centerMap: true
}
)
map.add_dataset(
    LocalDatasetCreationProps(
        id="test-data-id",
        data=TIME_DF,
    )
)

addTileDataset Skip link to addTileDataset

Adds a new remote dataset to the map, fetching dataset information from the appropriate URL.

JavaScriptPython

addTileDataset(
  dataset: TileDatasetCreationProps,
  options?: AddDatasetOptions
): Promise<Dataset>;`
def add_tile_dataset(
    self,
    dataset: Union[\
        VectorTileDatasetRemoteCreationProps,\
        RasterTileDatasetRemoteCreationProps,\
        Dict,\
    ],
    *,
    auto_create_layers: bool = True,
    center_map: bool = True,
) -> Optional[Dataset]

Javascript Skip link to Javascript

Arguments Skip link to Arguments

Argument Type Description
dataset TileDatasetCreationProps The dataset to add.
options AddDatasetOptions Optional map settings for the new dataset.

Returns Skip link to Returns

Returns a promise with the Dataset object that was added to the map.

Python Skip link to Python

Positional Arguments Skip link to Positional Arguments

Argument Type Description
dataset [Union[ Dataset, Dict, None] The dataset to add.
\

Keyword Arguments Skip link to Keyword Arguments\


| Argument | Type | Description |
| --- | --- | --- |
| auto_create_layers | bool | Whether to attempt to create new layers when adding a dataset. Defaults to True. |
| center_map | bool | Whether to center the map on the created dataset. Defaults to True. |
| id | str | Unique identifier of the dataset. If not provided, a random id will be generated. |
| label | str | Displayable dataset label. |
| color | Tuple[float, float, float] | Color label of the dataset. |
| metadata | dict | Object containing tileset metadata (for tiled datasets). |
\

Returns Skip link to Returns\


Returns a promise with the Dataset object that was added to the map.
\

Examples Skip link to Examples\


JavaScriptPython
\

map.addTileDataset(\
  {\
    id: 'foo',\
    type: 'raster-tile',\
    label: 'Dataset',\
    color: [0, 92, 255],\
    metadata: {\
      // NOTE: This must be a live, reachable URL\
      metadataUrl: 'https://path.to.metadata.json'\
    }\
  },\
  {\
    autoCreateLayers: true,\
    centerMap: true\
  }\
)\
```\
\
```python\
map.add_tile_dataset(RasterTileDatasetRemoteCreationProps(\
    id="dataset-id",\
    label="dataset-label",\
    metadata=RasterTileRemoteMetadata(\
        metadata_url=Url("http://example.com"),\
    )\
))\
```\
\
* * *\
\
## getDatasetById   [Skip link to getDatasetById](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getdatasetbyid)\
\
Retrieves a dataset by its identifier if it exists.\
\
JavaScriptPython\
\
```javascript\
getDatasetById(\
  datasetId: string\
): Dataset | null;\
```\
\
```python\
get_dataset_by_id(\
  self,\
  dataset_id: str\
) -> Optional[Dataset]:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-6)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-10)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `datasetId` | `string` | The identifier of the dataset to retrieve. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-11)\
\
Returns a [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object associated with the identifier, or `null` if no matching dataset was retrieved.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-6)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-11)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `dataset_id` | `string` | The identifier of the dataset to retrieve. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-12)\
\
Returns a [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object associated with the identifier, or `null` if no matching dataset was retrieved.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-7)\
\
JavaScriptPython\
\
```javascript\
dataset = map.getDatasetById('test-dataset-01');\
```\
\
```python\
dataset = map.get_dataset_by_id("test-dataset-01")\
```\
\
* * *\
\
## getDatasetWithData   [Skip link to getDatasetWithData](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getdatasetwithdata)\
\
Retrieves a dataset record with its data for a given dataset if it exists.\
\
JavaScriptPython\
\
```javascript\
getDatasetWithData(\
  datasetId: string\
): DatasetWithData | null;`}\
```\
\
```python\
get_dataset_with_data(\
  self,\
  dataset_id: str\
) -> Optional[DatasetWithData]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-7)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-12)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `datasetId` | `string` | The identifier of the dataset to retrieve. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-13)\
\
Returns a [`DatasetWithData`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#datasetwithdata) record along with its data associated with the identifier, or `null` if no matching dataset was retrieved.\
\
#### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-7)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `dataset_id` | `string` | The identifier of the dataset to retrieve. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-14)\
\
Returns a [`DatasetWithData`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#datasetwithdata) record along with its data associated with the identifier, or `null` if no matching dataset was retrieved.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-8)\
\
JavascriptPython\
\
```javascript\
dataset = map.getDatasetWithData('test-dataset-01');\
```\
\
```python\
dataset = map.get_dataset_with_data('test-dataset-01')\
```\
\
* * *\
\
## getDatasets   [Skip link to getDatasets](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getdatasets)\
\
_Python: `get_datasets`_\
\
Gets all the datasets currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getDatasets(): Dataset[];\
```\
\
```python\
get_datasets(self) -> List[Dataset]\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-15)\
\
Returns an array of [`Dataset`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) objects associated with the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-9)\
\
JavaScriptPython\
\
```javascript\
datasets = map.getDatasets();\
```\
\
```python\
datasets = map.get_datasets()\
```\
\
* * *\
\
## removeDataset   [Skip link to removeDataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#removedataset)\
\
_Python: `remove_dataset`_\
\
Removes a specified dataset from the map.\
\
JavaScriptPython\
\
```javascript\
removeDataset(\
  datasetId: string\
): void;\
```\
\
```python\
remove_dataset(\
  self,\
  dataset_id: str\
)-> None\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-8)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-13)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `datasetId` | `string` | The identifier of the dataset to remove. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-8)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `dataset_id` | `string` | The identifier of the dataset to remove. |\
\
#### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-10)\
\
JavaScriptPython\
\
```javascript\
map.removeDataset('test-dataset-01');\
```\
\
```python\
map.remove_dataset('test-dataset-01')\
```\
\
* * *\
\
## replaceDataset   [Skip link to replaceDataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#replacedataset)\
\
_Python: `replace_dataset`_\
\
Replaces a given dataset with a new one.\
\
JavaScriptPython\
\
```javascript\
replaceDataset(\
  thisDatasetId: string,\
  withDataset: DatasetCreationProps\
  options?: ReplaceDatasetOptions\
): Dataset;\
```\
\
```python\
def replace_dataset(\
    self,\
    this_dataset_id: str,\
    with_dataset: Union[\
        LocalDatasetCreationProps,\
        RasterTileDatasetCreationProps,\
        VectorTileDatasetCreationProps,\
        Dict,\
    ],\
    *,\
    force: bool = False,\
    strict: bool = False,\
) -> Dataset\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-9)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-14)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `thisDatasetId` | `string` | Identifier of the dataset to replace. |\
| `withDataset` | [`DatasetCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#datasetcreationprops) | Dataset details to replace the dataset with. |\
| `options` | [`ReplaceDatasetOptions`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#replacedatasetoptions) | Options available for dataset replacement. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-16)\
\
Returns the [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object that is now in use.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-9)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-15)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `this_dataset_id` | `string` | Identifier of the dataset to replace. |\
| `with_dataset` | `Union[Dataset, Dict, None]` | Dataset details to replace the dataset with. |\
| `force` | `bool` | Whether to force a dataset replace, even if the compatibility check fails. Default: `false`. |\
| `strict` | `bool` | Whether to ensure strict equality of types for each field being replaced. Default: `false`. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-17)\
\
Returns the [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object that is now in use.\
\
#### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-11)\
\
JavaScriptPython\
\
```javascript\
// suppose newDataset is a valid Dataset object\
map.replaceDataset('old-dataset-01', newDataset);\
```\
\
```python\
map.replace_dataset(\
    this_dataset_id="dataset-id-to-replace",\
    with_dataset=LocalDatasetCreationProps(\
        data=my_data,\
    ),\
    strict=True\
)\
```\
\
* * *\
\
## updateDataset   [Skip link to updateDataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatedataset)\
\
_Python: `update_dataset`_\
\
Updates an existing dataset's settings.\
\
JavaScriptPython\
\
```javascript\
updateDataset(\
  datasetId: string,\
  values: DatasetUpdateProps\
): Dataset;\
```\
\
```python\
def update_dataset(\
    self,\
    dataset_id: str,\
    values: Union[DatasetUpdateProps, dict],\
) -> Dataset\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-10)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-16)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `datasetId` | `string` | The identifier of the dataset to update. |\
| `values` | [`DatasetUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#datasetupdateprops) | The values to update. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-18)\
\
Returns the updated [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-10)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-2)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `dataset_id` | `string` | The identifier of the dataset to update. |\
| `values` | `Union[_DatasetUpdateProps, dict, None]` | The values to update. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-2)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `label` | `str` | Displayable dataset label. |\
| `color` | [`RGBColor`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#rgbcolor) | Color label of the dataset. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-19)\
\
For non-interactive (i.e. pure HTML) maps, nothing is returned.\
\
Returns the updated [Dataset](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#dataset) object for interactive maps, or `None` for non-interactive HTML environments.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-12)\
\
JavaScriptPython\
\
```javascript\
map.updateDataset(\
  "test-dataset-01",\
  {\
    label: "Dataset",\
    color: [245, 166, 35],\
  }\
);\
```\
\
```python\
map.update_dataset('dataset-id', DatasetUpdateProps(\
    label="My new label",\
    color=(255,0,0)\
))\
```\
\
* * *\
\
# Filter Functions   [Skip link to Filter Functions](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#filter-functions)\
\
* * *\
\
## addFilter   [Skip link to addFilter](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addfilter)\
\
_Python: `add_filter`_\
\
Add a filter to the map.\
\
JavaScriptPython\
\
```javascript\
addFilter(filter: FilterCreationProps): Filter\
```\
\
```python\
def add_filter(\
    self,\
    filter: Union[\
      PartialRangeFilter,\
      PartialSelectFilter,\
      PartialTimeRangeFilter,\
      PartialMultiSelectFilter,\
      dict\
    ],\
) -> Optional[Union[RangeFilter, SelectFilter, TimeRangeFilter, MultiSelectFilter]]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-11)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-17)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter` | [`FilterCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filtercreationprops) | The filter to add. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-20)\
\
Returns the [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object that was added to the map.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-11)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-3)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter` | `Union[` [FilterCreationProps](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filtercreationprops)`, dict, None]` | The filter to add. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-21)\
\
Returns the [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object that was added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-13)\
\
JavaScriptPython\
\
```javascript\
map.addFilter({\
  "type": "range",\
  "sources": [\
    {\
      "dataId": "test-dataset-filter",\
      "fieldName": "Magnitude"\
    }\
  ],\
  "value": [\
    4,\
    5\
  ]\
});\
```\
\
```python\
map.add_filter(PartialRangeFilter(\
    sources=[PartialFilterSource(\
        data_id="test-dataset-filter",\
        field_name="Magnitude"\
    )],\
    value=(4,5)\
))\
```\
\
* * *\
\
## addFilterFromConfig   [Skip link to addFilterFromConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addfilterfromconfig)\
\
_Python: `add_filter_from_config`_\
\
Add a filter to the map based on its JSON config. These methods can use the content of filter JSON editors directly.\
\
JavaScriptPython\
\
```javascript\
addFilterFromConfig(filterConfig: FilterCreationFromConfigProps): Filter\
```\
\
```python\
add_filter_from_config(\
  self,\
  filter_config: Union[Dict, str]\
) -> Filter:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-12)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-18)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterConfig` | `FilterCreationFromConfigProps` | The JSON config for the filter to add. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-22)\
\
Returns the [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object that was added to the map.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-12)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-4)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter_config` | `Union[dict, str]` (same shape as `FilterCreationFromConfigProps`) | The JSON config for the filter to add. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-23)\
\
Returns the [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object that was added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-14)\
\
JavaScriptPython\
\
```javascript\
map.addFilterFromConfig({\
  name: ['time'],\
  type: 'timeRange',\
  dataId: [TIME_DATASET_ID],\
  view: 'minified',\
  value: [1655250010, 1655250990],\
  animationWindow: 'free',\
  yAxis: null,\
  speed: 1,\
  plotType: {\
    type: 'histogram',\
    interval: '1-minute',\
    aggregation: 'SUM',\
    defaultTimeFormat: 'L  LT'\
  }\
});\
```\
\
```python\
map.add_filter_from_config("""{\
  "id": "test-filter",\
  "type": "timeRange",\
  "name": ["time"],\
  "dataId": ["test-data-id"],\
  "view": "minified",\
  "value": [1655250010, 1655250990],\
  "animationWindow": "free",\
  "yAxis": null,\
  "speed": 1,\
  "plotType": { "type": "histogram" }\
}""")\
```\
\
* * *\
\
## getFilterById   [Skip link to getFilterById](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getfilterbyid)\
\
_Python: `get_filter_by_id`_\
\
Retrieves a filter by its identifier if it exists.\
\
JavaScriptPython\
\
```javascript\
getFilterById(\
  filterId: string\
): Filter | null;\
```\
\
```python\
get_filter_by_id(\
  self,\
  filter_id: str\
) -> Optional[Filter]`}\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-13)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-19)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterId` | `string` | Identifier of the filter to get. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-24)\
\
Returns a [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object associated a given identifier, or `null` if one doesn't exist.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-13)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-20)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter_id` | `string` | Identifier of the filter to get. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-25)\
\
Returns a [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object associated a given identifier, or `null` if one doesn't exist.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-15)\
\
JavaScriptPython\
\
```javascript\
filter = map.getFilterById('test-filter-01');\
```\
\
```python\
filter = map.get_filter_by_id('test-filter-01')\
```\
\
* * *\
\
## getFilters   [Skip link to getFilters](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getfilters)\
\
_Python: `get_filters`_\
\
Gets all the filters currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getFilters(): Filter[];\
```\
\
```python\
get_filters(self) -> List[Filter]\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-26)\
\
Returns an array of [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) objects.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-16)\
\
JavaScriptPython\
\
```javascript\
filters = map.getFilters();\
```\
\
```python\
filters = map.get_filters()\
```\
\
* * *\
\
## removeFilter   [Skip link to removeFilter](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#removefilter)\
\
_Python: `remove_filter`_\
\
Removes a filter from the map.\
\
JavaScriptPython\
\
```javascript\
removeFilter(\
  filterId: string\
): void;\
```\
\
```python\
remove_filter(\
  self,\
  filter_id: str\
) -> None\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-14)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-21)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterId` | `string` | The id of the filter to remove. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-14)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-22)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterId` | `string` | The id of the filter to remove. |\
\
#### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-17)\
\
JavaScriptPython\
\
```javascript\
map.removeFilter('test-filter-01');\
```\
\
```python\
map.remove_filter('test-filter-01')\
```\
\
* * *\
\
## updateFilter   [Skip link to updateFilter](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatefilter)\
\
_Python: `update_filter`_\
\
Updates an existing filter with given values.\
\
JavaScriptPython\
\
```javascript\
updateFilter(\
  filterId: string,\
  values: FilterUpdateProps\
): Filter;`\
```\
\
```python\
update_filter(\
  self,\
  filter_id: str,\
  values: Union[FilterUpdateProps, dict, None] = None,\
) -> Filter\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-15)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-23)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterId` | `string` | The id of the filter to update. |\
| `values` | [`FilterUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filterupdateprops) | The new filter values. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-27)\
\
Returns the updated [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-15)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-24)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter_id` | `string` | The id of the filter to update. |\
| `values` | `Union[` [`FilterUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filterupdateprops)`, dict, None]` | The new filter values. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-28)\
\
Returns the updated [Filter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filter) object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-18)\
\
JavaScriptPython\
\
```javascript\
map.addFilter('test-filter-1',{\
  "type": "range",\
  "sources": [\
    {\
      "dataId": "test-dataset-filter",\
      "fieldName": "Magnitude"\
    }\
  ],\
  "value": [\
    5,\
    6\
  ]\
})\
```\
\
```python\
def update_filter(\
    self,\
    filter_id: str,\
    values: Union[\
        PartialRangeFilter,\
        PartialSelectFilter,\
        PartialTimeRangeFilter,\
        PartialMultiSelectFilter,\
        dict,\
    ],\
) -> Union[RangeFilter, SelectFilter, TimeRangeFilter, MultiSelectFilter]\
```\
\
* * *\
\
## updateTimeline   [Skip link to updateTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatetimeline)\
\
_Python: `update_timeline`_\
\
Updates a time range filter timeline with given values.\
\
JavaScriptPython\
\
```javascript\
updateTimeline(\
  filterId: string,\
  values: FilterTimelineUpdateProps\
): TimeRangeFilter;\
```\
\
```python\
def update_timeline(\
    self,\
    filter_id: str,\
    values: Union[FilterTimelineUpdateProps, dict],\
) -> TimeRangeFilter\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-16)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-25)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filterId` | `string` | The id of the time range filter to update. |\
| `values` | [`FilterTimelineUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filtertimelineupdateprops) | The new layer timeline values. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-29)\
\
Returns the updated [TimeRangeFilter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#timerangefilter) object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-16)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-5)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `filter_id` | `string` | The id of the time range filter to update. |\
| `values` | `(Union[`, [`FilterTimelineUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filtertimelineupdateprops)`dict, None]` | The new layer timeline values. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-3)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `view` | [`FilterView`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filterview) | Current timeline presentation. |\
| `time_format` | `string` | Time format that the timeline is using in day.js supported format. Reference: [https://day.js.org/docs/en/display/format](https://day.js.org/docs/en/display/format) |\
| `timezones` | `string` | Timezone that the timeline is using in tz format. Reference: [https://en.wikipedia.org/wiki/List\_of\_tz\_database\_time\_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |\
| `is_animating` | `bool` | Flag indicating whether the timeline is animating or not. |\
| `animation_speed` | `Number` | Speed at which timeline is animating. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-30)\
\
Returns the updated [TimeRangeFilter](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#timerangefilter) object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-19)\
\
JavaScriptPython\
\
```javascript\
map.updateTimeline('test-timeline-1', {\
  timeFormat: 'DD/MM/YYYY',\
  isAnimating: false\
});\
```\
\
```python\
map.update_timeline("filter-id", FilterTimelineUpdateProps(\
    view="side",\
    is_animating=True\
))\
```\
\
* * *\
\
# Layer Functions   [Skip link to Layer Functions](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#layer-functions)\
\
* * *\
\
## addLayer   [Skip link to addLayer](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addlayer)\
\
_Python: `add_layer`_\
\
Add a new layer to the map. This function requires at least one valid layer configuration to be supplied.\
\
To learn about configuring a specific layer programmatically, visit [Layer Configuration documentation](https://docs.foursquare.com/developer/docs/studio-layer-configuration).\
\
> 📝\
>\
> ### Note:   [Skip link to Note:](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#note-1)\
>\
> For Typescript, we recommend using [`addLayerFromConfig()`](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference#addlayerfromconfig).\
>\
> For Python users, we recommend using [`add_layer_from_config()`](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference#addlayerfromconfig) and specialized layer classes. See [Python best practices](https://docs.foursquare.com/developer/docs/map-sdk-python).\
\
JavaScriptPython\
\
```javascript\
addLayer(\
  layer: LayerCreationProps\
): Layer;\
```\
\
```python\
def add_layer(self, layer: Union[LayerCreationProps, dict]) -> Optional[Layer]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-17)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-26)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layer` | [`LayerCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layercreationprops) | A set of properties used to create a layer. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-31)\
\
The [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object that was added to the map.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-17)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-27)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layer` | `Union[` [`LayerCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layercreationprops)`, dict, None]` | A set of properties used to create a layer. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-32)\
\
The [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object that was added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-20)\
\
JavaScriptPython\
\
```javascript\
map.addLayer({\
  id: 'test-layer-01',\
  type: 'point',\
  dataId: 'test-dataset-01',\
  label: 'New Layer',\
  isVisible: true,\
  fields: {\
    lat: 'latitude',\
    lng: 'longitude'\
  },\
  config: {\
    visualChannels: {\
      colorField: {\
        name: 'cityName',\
        type: 'string'\
      },\
      colorScale: 'ordinal'\
    }\
  }\
});\
```\
\
```python\
map.add_layer(\
    LayerCreationProps(\
        id="test-layer-01",\
        type=LayerType.POINT\
        data_id="test-dataset-01",\
        label="New Layer",\
        is_visible=True,\
        fields={"lat": "latitude", "lng": "longitude"},\
        config={\
            "visual_channels": {\
                "color_field": {"name": "city_name", "type": "string"},\
                "color_scale":"ordinal",\
            }\
        },\
    )\
)\
```\
\
* * *\
\
## addLayerFromConfig   [Skip link to addLayerFromConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addlayerfromconfig)\
\
_Python: `add_layer_from_config`_\
\
Adds a layer using the specified config. Provides improved typing over `addLayer()`, and can work with JSON objects from the JSON editor for layers directly.\
\
Use `addLayerFromConfig()` over [`addLayer()`](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference#addlayer) when working with large, non-trivial layer configurations.\
\
JavaScriptPython\
\
```javascript\
addLayerFromConfig(layerConfig: LayerCreationFromConfigProps): Layer;\
```\
\
```python\
add_layer_from_config(\
  self, layer_config: FullLayerConfig\
) -> Layer:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-18)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-28)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layerConfig` | [Layer JSON Configuration](https://docs.foursquare.com/developer/docs/studio-layer-configuration) | A layer config. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-33)\
\
The [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object that was added to the map.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-18)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-29)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layer_config` | [Layer JSON Configuration](https://docs.foursquare.com/developer/docs/studio-layer-configuration) | A layer config. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-34)\
\
The [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object that was added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-21)\
\
JavaScriptPython\
\
```javascript\
map.addLayerFromConfig({\
  type: 'point',\
  config: {\
    dataId: myDataset.id,\
    columnMode: 'points',\
    columns: {\
      lat: 'lat',\
      lng: 'lon'\
    },\
    visConfig: {},\
    color: [0, 255, 0]\
  }\
});\
```\
\
```python\
# create a disctionary or...\
map.add_layer_from_config(\
  {\
    "id": "sample-layer",\
    "type": "point",\
    "config": {\
      "dataId": "sample-data",\
      "label": "Sample layer",\
      "columnMode": "points",\
      "columns": {"lat": "Latitude", "lng": "Longitude"},\
      "visConfig": {},\
      "color": [0, 255, 0],\
      "textLabel": [],\
    },\
  }\
)\
\
# ...paste a JSON string directly from the JSON editor\
map.add_layer_from_config("""\
{\
  "id": "sample-layer-json-str",\
  "type": "point",\
  "config": {\
    "dataId": "sample-data",\
    "label": "Sample layer str",\
    ...\
    ...\
    "columnMode": "points",\
    "columns": {\
    "lat": "Latitude",\
    "lng": "Longitude"\
    }\
  },\
  "visualChannels": {\
    "colorField": null,\
    "colorScale": "quantile",\
    "strokeColorField": null,\
    "strokeColorScale": "quantile",\
    "sizeField": null,\
    "sizeScale": "linear"\
  }\
}\
""")\
```\
\
* * *\
\
## addLayerGroup   [Skip link to addLayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addlayergroup)\
\
_Python: `add_layer_group`_\
\
Adds a new layer group to the map.\
\
JavaScriptPython\
\
```javascript\
addLayerGroup(layerGroup: LayerGroup): LayerGroup;\
```\
\
```python\
def add_layer_group(\
    self, layer_group: Union[LayerGroupCreationProps, dict]\
) -> LayerGroup\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-35)\
\
Returns the [LayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layergroup) object added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-22)\
\
JavaScriptPython\
\
```javascript\
map.addLayerGroup({\
  id: 'layer-group-1',\
  label: 'Layer Group 1',\
  isVisible: true,\
  layerIds: ['layer1', 'layer2', 'layer3']\
});\
```\
\
```python\
map.add_layer_group(LayerGroupCreationProps(\
    id="layer-group-1",\
    label="Layer Group 1",\
    is_visible=True,\
    layer_ids=["layer1", "layer2", "layer3"]\
))\
```\
\
* * *\
\
## getLayerById   [Skip link to getLayerById](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayerbyid)\
\
_Python: `get_layer_by_id`_\
\
Retrieves a layer by its identifier if it exists.\
\
JavaScriptPython\
\
```javascript\
getLayerById(\
  layerId: string\
): Layer | null;\
```\
\
```python\
def get_layer_by_id(\
  self,\
  layer_id: str\
) -> Optional[Layer]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-19)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-30)\
\
| Parameter | Type | Description |\
| --- | --- | --- |\
| `layerId` | `string` | Identifier of the layer to get. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-19)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-31)\
\
| Parameter | Type | Description |\
| --- | --- | --- |\
| `layer_id` | `string` | Identifier of the layer to get. |\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-36)\
\
Returns the [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object associated with the identifier, or `null` if one doesn't exist.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-23)\
\
JavaScriptPython\
\
```javascript\
layer = map.getLayerById('test-layer-01');\
```\
\
```python\
layer = map.get_layer_by_id('test-layer-01')\
```\
\
* * *\
\
## getLayerGroupById   [Skip link to getLayerGroupById](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayergroupbyid)\
\
_Python: `get_layer_group_by_id`_\
\
Retrieves a layer group by its identifier if it exists.\
\
JavaScriptPython\
\
```javascript\
getLayerGroupById(layerGroupId: string): LayerGroup | null;\
```\
\
```python\
get_layer_group_by_id(self, layer_group_id: str) -> Optional[LayerGroup]:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-37)\
\
Returns a [LayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layergroup) associated with the identifer, or null if one doesn't exist.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-24)\
\
JavaScriptPython\
\
```javascript\
layerGroup = map.getLayerGroupById('layer-group-1');\
```\
\
```python\
layer_group = map.get_layer_group_by_id("layer-group-1")\
```\
\
* * *\
\
## getLayerGroups   [Skip link to getLayerGroups](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayergroups)\
\
_Python: `get_layer_groups`_\
\
Gets all the layer groups currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getLayerGroups(): LayerGroup[];\
```\
\
```python\
get_layer_groups(self) -> List[LayerGroup]\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-38)\
\
Returns an array of [LayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layergroup) objects associated with the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-25)\
\
JavaScriptPython\
\
```javascript\
layerGroups = map.getLayerGroups();\
```\
\
```python\
layer_groups = map.get_layer_groups()\
```\
\
* * *\
\
## getLayerTimeline   [Skip link to getLayerTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayertimeline)\
\
_Python: `get_layer_timeline`_\
\
Gets all the layers currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getLayerTimeline(): LayerTimeline | null;\
```\
\
```python\
get_layer_timeline(self) -> Optional[LayerTimeline]:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-39)\
\
Returns a [LayerTimeLine](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimeline) object associated with the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-26)\
\
JavaScriptPython\
\
```javascript\
layerTimeline = map.getLayerTimeline();\
```\
\
```python\
layer_timeline = map.get_layer_timeline()\
```\
\
* * *\
\
## getLayers   [Skip link to getLayers](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayers)\
\
_Python: `get_layers`_\
\
Gets all the layers currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getLayers(): Layer[];\
```\
\
```python\
get_layers(self) -> List[Layer]\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-40)\
\
Returns an array of [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) objects associated with the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-27)\
\
JavaScriptPython\
\
```javascript\
layers = map.getLayers();\
```\
\
```python\
layers = map.get_layers()\
```\
\
* * *\
\
## getLayerTimeline   [Skip link to getLayerTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getlayertimeline-1)\
\
_Python: `get_layer_timeline`_\
\
Gets all the layers currently available in the map.\
\
JavaScriptPython\
\
```javascript\
getLayerTimeline(): LayerTimeline | null;\
```\
\
```python\
get_layer_timeline(self) -> Optional[LayerTimeline]:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-41)\
\
Returns a [LayerTimeLine](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimeline) object associated with the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-28)\
\
JavaScriptPython\
\
```javascript\
layerTimeline = map.getLayerTimeline();\
```\
\
```python\
layer_timeline = map.get_layer_timeline()\
```\
\
* * *\
\
## removeLayer   [Skip link to removeLayer](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#removelayer)\
\
_Python: `remove_layer`_\
\
Removes a layer from the map.\
\
JavaScriptPython\
\
```javascript\
removeLayer(\
  layerId: string\
): void;\
```\
\
```python\
remove_layer(\
  self,\
  layer_id: str\
) -> None\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-20)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-32)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layerId` | `string` | The id of the layer to remove. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-20)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-33)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layer_id` | `string` | The id of the layer to remove. |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-29)\
\
JavaScriptPython\
\
```javascript\
map.removeLayer('test-layer-01');\
```\
\
```python\
map.remove_layer('test-layer-01')\
```\
\
* * *\
\
## removeLayerGroup   [Skip link to removeLayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#removelayergroup)\
\
_Python: `remove_layer_group`_\
\
Removes a layer group from the map. This operation _does not_ remove the layers itself; only the layer group.\
\
JavaScriptPython\
\
```javascript\
removeLayerGroup(layerGroupId: string): void;\
```\
\
```python\
remove_layer_group(self, layer_group_id: str) -> None:\
```\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-30)\
\
JavaScriptPython\
\
```javascript\
map.removeLayerGroup('layer-group-1');\
```\
\
```python\
remove_layer_group(self, layer_group_id: str) -> None:\
```\
\
* * *\
\
## updateLayer   [Skip link to updateLayer](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatelayer)\
\
_Python: `update_layer`_\
\
Updates an existing layer with given values.\
\
JavaScriptPython\
\
```javascript\
updateLayer(\
  layerId: string,\
  values: LayerUpdateProps\
): Layer;\
```\
\
```python\
def update_layer(\
    self, layer_id: str, values: Union[LayerUpdateProps, dict]\
) -> Layer\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-21)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-34)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layerId` | `string` | The id of the layer to update. |\
| `values` | [`LayerUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layerupdateprops) | The values to update. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-42)\
\
Returns the updated [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-21)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-6)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `layer_id` | `string` | The id of the layer to update. |\
| `values` | `Union[` [`LayerUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layerupdateprops)`, dict, None]` | The values to update. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-4)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `type` | [`LayerType`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertype) | The type of layer. |\
| `data_id` | `string` | Unique identifier of the dataset this layer visualizes. |\
| `fields` | `Dict [string, Optional[string]]` | Dictionary that maps fields that the layer requires for visualization to appropriate dataset fields. |\
| `label` | `string` | Canonical label of this layer |\
| `is_visible` | `bool` | Whether the layer is visible or not. |\
| `config` | [`LayerConfig`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layerconfig) | Layer configuration specific to its type. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-43)\
\
Returns the updated [Layer](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layer) object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-31)\
\
JavaScriptPython\
\
```javascript\
map.updateLayer({\
  type: 'point',\
  dataId: 'test-dataset-01',\
  label: 'Updated Layer',\
  isVisible: true,\
  fields: {\
    lat: 'latitude',\
    lng: 'longitude',\
    alt: 'altitude'\
  },\
  config: {\
    visualChannels: {\
      colorField: {\
        name: 'cityName',\
        type: 'string'\
      }\
    },\
    visConfig: {\
      radius: 10,\
      fixedRadius: false,\
      opacity: 0.8,\
      outline: false,\
      thickness: 2\
    }\
  }\
});\
```\
\
```python\
map.update_layer('layer-id', LayerUpdateProps(\
    label="My new label"\
))\
```\
\
* * *\
\
## updateLayerGroup   [Skip link to updateLayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatelayergroup)\
\
_Python: `update_layer_group`_\
\
Updates an existing layer group with given values.\
\
JavaScriptPython\
\
```javascript\
updateLayerGroup(layerGroupId: string, values: LayerGroupUpdateProps): LayerGroup;\
```\
\
```python\
def update_layer_group(\
    self,\
    layer_group_id: str,\
    values: Union[LayerGroupUpdateProps, dict],\
) -> LayerGroup\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-44)\
\
Returns the updated [LayerGroup](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layergroup).\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-32)\
\
JavaScriptPython\
\
```javascript\
map.updateLayerGroup(\
    "layer-group-1",\
    {\
      id: "layer-group-1",\
      label: "Layer Group 1",\
      isVisible: false,\
      layerIds: ["layer1", "layer2". "layer3"]\
    }\
);\
```\
\
```python\
map.update_layer_group(LayerGroupUpdateProps(\
    "layer-group-1",\
    label = "New Layer Group 1",\
    layers = ["layer1", "layer2"]\
))\
```\
\
* * *\
\
## updateLayerTimeline   [Skip link to updateLayerTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updatelayertimeline)\
\
_Python: `update_layer_timeline`_\
\
Updates the current layer timeline configuration.\
\
JavaScriptPython\
\
```javascript\
map.updateLayerTimeline({\
    currentTime: 1660637600498,\
    isAnimating: true,\
    isVisible: true,\
    animationSpeed: 1,\
    timeFormat: "YYYY-MM-DDTHH:mm:ss",\
    timezone: "America/Los_Angeles"\
  }\
);\
```\
\
```python\
def update_layer_timeline(\
    self, values: Union[LayerTimelineUpdateProps, dict]\
) -> LayerTimeline\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-22)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-35)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `values` | [`LayerTimelineUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimelineupdateprops) | The new layer timeline values. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-45)\
\
Returns the updated [LayerTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimeline) object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-22)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-7)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `values` | `(Union[`, [`LayerTimelineUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimelineupdateprops)`dict, None]` | The new layer timeline values. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-5)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `current_time` | `Number` | Current time on the timeline in milliseconds |\
| `is_animating` | `bool` | Flag indicating whether the timeline is animating or not. |\
| `is_visibile` | `bool` | Flag indicating whether the timeline is visible or not |\
| `animation_speed` | `Number` | Speed at which timeline is animating. |\
| `time_format` | `string` | Time format that the timeline is using in day.js supported format. Reference: [https://day.js.org/docs/en/display/format](https://day.js.org/docs/en/display/format) |\
| `timezone` | `string` | Timezone that the timeline is using in tz format. [https://en.wikipedia.org/wiki/List\_of\_tz\_database\_time\_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-46)\
\
Returns the updated [LayerTimeline](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layertimeline) object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-33)\
\
JavaScriptPython\
\
```javascript\
map.updateLayerTimeline({\
    currentTime: 1660637600498,\
    isAnimating = true,\
    isVisible = true,\
    animationSpeed = 1,\
    timeFormat = "YYYY-MM-DDTHH:mm:ss",\
    timezone = "America/Los_Angeles"\
  }\
);\
```\
\
```python\
map.update_layer_timeline(LayerTimelineUpdateProps(\
    current_time=1660637600498,\
    is_animating=True,\
    is_visible=True,\
    animation_speed=1,\
    time_format="YYYY-MM-DDTHH:mm:ss",\
    timezone="America/Los_Angeles"\
))\
```\
\
* * *\
\
# Map Functions   [Skip link to Map Functions](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#map-functions)\
\
* * *\
\
## addToDOM   [Skip link to addToDOM](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addtodom)\
\
_Javascript-exclusive function._\
\
Adds a map into a container element provided as an argument.\
\
> Note: This is normally done in the constructor and does not need to be called explicitly.\
\
JavaScript\
\
```javascript\
addToDOM(\
  container: HTMLElement,\
  style?: CSSProperties\
): void;\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-23)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-36)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `container` | `HTMLElement` | The container element to embed the map into. |\
| `style` | `CSSProperties` | An optional set of CSS properties. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-47)\
\
Returns the container element to embed the map into.\
\
#### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-34)\
\
JavaScript\
\
```javascript\
map.addToDOM(container, foo.style);\
```\
\
* * *\
\
## addEffect   [Skip link to addEffect](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#addeffect)\
\
_Python: `add_effect`_\
\
Add a new visual [post-processing effect](https://docs.foursquare.com/studio/docs/maps-effects) to the map.\
\
JavaScriptPython\
\
```javascript\
addEffect(\
  effect: EffectCreationProps\
): Effect;\
```\
\
```python\
def add_effect(self, effect: Union[EffectCreationProps, dict]) -> Effect\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-24)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-37)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `effect` | [`EffectCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effectcreationprops) | A set of properties used to create an effect. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-48)\
\
Returns the effect that was added.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-23)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `effect` | [`EffectCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effectcreationprops) | A set of properties used to create an effect. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-49)\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-35)\
\
JavaScriptPython\
\
```javascript\
map.addEffect({\
  id: "example-effect",\
  type: "light-and-shadow",\
  parameters: {\
    shadowIntensity: 0.5,\
    shadowColor: [0, 0, 0],\
    sunLightColor: [255, 255, 255],\
    sunLightIntensity: 1,\
    ambientLightColor: [255, 255, 255],\
    ambientLightIntensity: 1,\
    timeMode: "current",\
  },\
});\
```\
\
```python\
map.add_effect(\
    EffectCreationProps(\
        id="effect-id",\
        type=EffectType.INK,\
        is_enabled=False,\
        parameters={"strength": 0.33},\
    )\
)\
```\
\
* * *\
\
## createMap   [Skip link to createMap](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#createmap)\
\
_Python: `create_map`_\
\
Creates a new map instance based on given Arguments.\
\
JavaScriptPython\
\
```javascript\
createMap(\
  props: MapCreationProps\
): Promise<MapApi>\
```\
\
```python\
def create_map(\
    *,\
    api_key: str,\
    renderer: Literal["html", "widget", None] = None,\
    initial_state: Optional[Dict] = None,\
    style: Optional[Dict] = None,\
    basemaps: Optional[Dict] = None,\
    urls: Optional[Dict] = None,\
    iframe: Optional[bool] = None,\
    raster: Optional[Dict] = None,\
    _internal: Optional[Dict] = None,\
) -> Union[HTMLMap, SyncWidgetMap]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-25)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-38)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `props` | [`MapCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcreationprops) | A set of properties used to create a layer. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-50)\
\
Returns a new map instance that can be interacted with.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-24)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-39)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `renderer` | `string` | The rendering method to use for map rendering, either `"html"` or `"widget"`. Defaults to `None`, automatically rendering a widget unless a Databricks environment is detected. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-6)\
\
Keyword arguments reflect the parameters found in [`SyncWidgetMap`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#syncwidgetmap) or most of the parameters found in [`HTMLMap`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#htmlmap):\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `style` | `Dict` | Optional map container CSS style customization. Uses camelCase as this is React standard. |\
| `basemaps` | `Dict` | Basemap customization settings. |\
| `basemaps["custom_map_styles"]` | `List[` [`MapStyleCreationProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapstylecreationprops)`]` | A set of properties required when specifying a map style. |\
| `basemaps["initial_map_styles"]` | `string` | A mapbox style ID. |\
| `raster` | `Dict` | Customization related to raster datasets and tiles. Not available when `renderer = "html"`. |\
| `raster.server_urls` | `List[string]` | URLs to custom servers to target when serving raster tiles. |\
| `raster.stac_search_url` | `string` | URL to pass to the backend for searching a STAC Collection. |\
| `urls` | `Dict` | <br> Customization of URLs used in the application. |\
| `urls.static_asset_url_base` | `string` | <br> Custom URL base for static assets. |\
| `urls.application_url_base` | `string` | <br> Custom URL base for workers and other script resources loaded by the SDK. |\
\
> Note: HTML rendering is provided for those working in a Databricks environment. While using this rendering method, API endpoints will not provide any return values. Using the default "widget" rendering method is strongly suggested.\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-51)\
\
Returns a [`SyncWidgetMap`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#syncwidgetmap) for most notebook environments, or an [`HTMLMap`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#htmlmap) object for a Databricks environment or when `renderer = "html"`.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-36)\
\
JavaScriptPython\
\
```javascript\
const map = createMap({apiKey: "<api-key>"});\
```\
\
```python\
map = create_map(api_key="<api-key>")\
```\
\
* * *\
\
## getEffectByID   [Skip link to getEffectByID](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#geteffectbyid)\
\
_Python: `get_effect_by_id`_\
\
Retrieves a visual effect from the map.\
\
JavaScriptPython\
\
```javascript\
getEffectById(effectId: string): Effect | null;\
```\
\
```python\
get_effect_by_id(effect_id: str) -> Optional[Effect]:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-52)\
\
Returns the [effect](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effect) associated with the ID.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-37)\
\
JavaScriptPython\
\
```javascript\
effect = map.getEffectByID();\
```\
\
```python\
effect = map.get_effect_by_id()\
```\
\
* * *\
\
## getEffects   [Skip link to getEffects](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#geteffects)\
\
_Python: `get_effects`_\
\
Retrieves all visual effects from the map.\
\
JavaScriptPython\
\
```javascript\
getEffects(): Effect[];\
```\
\
```python\
get_effects(self) -> List[Effect]:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-53)\
\
Returns an array of [effects](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effect) added to the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-38)\
\
JavaScriptPython\
\
```javascript\
effects = map.getEffects();\
```\
\
```python\
effects = map.get_effects()\
```\
\
* * *\
\
## getMapConfig   [Skip link to getMapConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getmapconfig)\
\
_Python: `get_map_config`_\
\
Gets the configuration representing the current map state.\
\
For more information, see the [JSON reference for the map configuration file](https://docs.foursquare.com/developer/docs/studio-map-configuration).\
\
JavaScriptPython\
\
```javascript\
getMapConfig(): unknown;\
```\
\
```python\
get_map_config(self) -> dict:\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-54)\
\
Returns the [map configuration file](https://docs.foursquare.com/developer/docs/studio-map-configuration).\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-39)\
\
JavaScriptPython\
\
```javascript\
mapConfig = map.getMapConfig();\
```\
\
```python\
map_config = map.get_map_config()\
```\
\
* * *\
\
## getMapControlVisibility   [Skip link to getMapControlVisibility](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getmapcontrolvisibility)\
\
_Python: `get_map_control_visibility`_\
\
Gets the current map control visibility settings.\
\
JavaScriptPython\
\
```javascript\
getMapControlVisibility(): MapControlVisibility;\
```\
\
```python\
get_map_control_visibility(self) -> MapControlVisibility\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-55)\
\
Returns a [`MapControlVisibility`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcontrolvisibility) object containing current map control visibility settings.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-40)\
\
JavaScriptPython\
\
```javascript\
mapVisibilitySettings = map.getMapControlVisibility();\
```\
\
```python\
map_visibility_settings = map.get_map_control_visibility()\
```\
\
* * *\
\
## getMapStyles   [Skip link to getMapStyles](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getmapstyles)\
\
_Python: `get_map_styles`_\
\
Gets the current map control visibility settings.\
\
JavaScriptPython\
\
```javascript\
getMapStyles(): MapStyle[];\
```\
\
```python\
get_map_styles(self) -> List[MapStyle]\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-56)\
\
Returns an array of [MapStyle](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapstyle) objects.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-41)\
\
JavaScriptPython\
\
```javascript\
mapStyles = map.getMapStyles();\
```\
\
```python\
map_styles = map.get_map_styles()\
```\
\
* * *\
\
## getSplitMode   [Skip link to getSplitMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getsplitmode)\
\
_Python: `get_split_mode`_\
\
Gets the current split mode of the map along with its associated layers.\
\
JavaScriptPython\
\
```javascript\
getSplitMode(): SplitModeProps;\
```\
\
```python\
get_split_mode(self) -> SplitModeProps\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-57)\
\
Returns a [`SplitModeProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmodeprops) object containing split mode settings for each associated layers.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-42)\
\
JavaScriptPython\
\
```javascript\
splitMode = map.getSplitMode();\
```\
\
```python\
split_mode = map.get_split_mode();\
```\
\
* * *\
\
## getView   [Skip link to getView](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getview)\
\
_Python: `get_view`_\
\
Gets the current view state of the map.\
\
JavaScriptPython\
\
```javascript\
getView(): View;\
```\
\
```python\
get_view(self) -> View\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-58)\
\
Returns a [`View`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view) object containing view state settings.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-43)\
\
JavaScriptPython\
\
```javascript\
view = map.getView();\
```\
\
```python\
view = map.get_view()\
```\
\
* * *\
\
## getViewLimits   [Skip link to getViewLimits](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getviewlimits)\
\
_Python: `get_view_limits`_\
\
Gets the current view limits of the map.\
\
JavaScriptPython\
\
```javascript\
getViewLimits(): ViewLimits;\
```\
\
```python\
get_view_limits(self) -> ViewLimits\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-59)\
\
Returns a [`ViewLimits`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewlimits) object containing the view limits setting of the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-44)\
\
JavaScriptPython\
\
```javascript\
viewLimits = map.getViewLimits();\
```\
\
```python\
view_limits = map.get_view_limits()\
```\
\
* * *\
\
## getViewMode   [Skip link to getViewMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#getviewmode)\
\
_Python: `get_view_mode`_\
\
Gets the current view mode of the map. View mode can be one of `"2d"`, `"3d"`, or `"globe"`.\
\
JavaScriptPython\
\
```javascript\
getViewMode(): ViewMode;\
```\
\
```python\
get_view_mode(self) -> ViewMode\
```\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-60)\
\
Returns a [`ViewMode`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewmode) object containing the view mode setting of the map.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-45)\
\
JavaScriptPython\
\
```javascript\
viewMode = map.getViewMode();\
```\
\
```python\
view_mode = map.get_view_mode()\
```\
\
* * *\
\
## remove\_event\_handlers   [Skip link to remove_event_handlers](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#remove_event_handlers)\
\
_Python exclusive function._\
\
Removes the specified event handlers from the map, layers, or filters.\
\
Python\
\
```python\
def remove_event_handlers(\
    self, event_handlers: Sequence[Union[str, EventType]]\
) -> None:\
```\
\
### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-40)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `event_handlers` | `Sequence[string]` | A list of event handlers to remove. Passed in as a list of strings. |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-46)\
\
Python\
\
```python\
map.remove_event_handlers(["on_view_update"])\
```\
\
* * *\
\
## set\_event\_handlers   [Skip link to set_event_handlers](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#set_event_handlers)\
\
_Python exclusive function._\
\
Applies the specified event handlers to the map, layers, or filters.\
\
Python\
\
```python\
def set_event_handlers(self, event_handlers: Union[dict, EventHandlers]) -> None\
```\
\
### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-41)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `event_handlers` | [`MapEventHandlers`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapeventhandlers), [`LayerEventHandlers`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#layereventhandlers), [`FilterEventHandlers`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#filtereventhandlers), `dict` | Event handlers to set. Can be passed as in through the aforementioned objects, as a dict, or through keyword arguments. |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-47)\
\
Python\
\
```python\
map.set_event_handlers(EventHandlers(on_view_update=my_handler_func))\
```\
\
* * *\
\
## setMapConfig   [Skip link to setMapConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setmapconfig)\
\
_Python: `set_map_config`_\
\
Loads the given configuration into the current map.\
\
JavaScriptPython\
\
```javascript\
setMapConfig(\
  config: object,\
  options?: SetMapConfigOptions\
): void;\
```\
\
```python\
set_map_config(\
  self,\
  config: dict,\
  options: Optional[Union[dict, SetMapConfigOptions]] = None\
) -> None:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-26)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-42)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `config` | `object` | Configuration to load into the map. For details around the format see [the map format reference](https://docs.foursquare.com/developer/docs/studio-map-configuration). |\
| `options` | [`SetMapConfigOptions`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#setmapconfigoptions) | A set of options for the map configuration. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-25)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-43)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `config` | `dict` | Configuration to load into the map. For details around the format see [the map format reference](https://docs.foursquare.com/developer/docs/studio-layer-configuration). |\
| `options` | `Union[dict,` [`SetMapConfigOptions`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#setmapconfigoptions)`]` | A set of options for the map configuration. |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-48)\
\
JavaScriptPython\
\
```javascript\
map.setMapConfig({\
  version: "v1",\
  config: {\
    visState: {\
      filters: [],\
      layers: [],\
      interactionConfig: {\
        tooltip: {\
          fieldsToShow: {},\
          compareMode: false,\
          compareType: "absolute",\
          enabled: true\
        },\
        brush: {\
          size: 0.5,\
          enabled: false\
        },\
        geocoder: {\
          enabled: false\
        },\
        coordinate: {\
          enabled: false\
        }\
      },\
      layerBlending: "normal",\
      overlayBlending: "normal",\
      splitMaps: [],\
      animationConfig: {\
        currentTime: null,\
        speed: 1\
      },\
      editor: {\
        features: [],\
        visible: true\
      },\
      metrics: [],\
      geoKeys: [],\
      groupBys: [],\
      datasets: {\
        fieldDisplayNames: {},\
        fieldDisplayFormats: {},\
        datasetColors: {}\
      },\
      joins: [],\
      analyses: [],\
      charts: []\
    },\
    mapState: {\
      bearing: 0,\
      dragRotate: false,\
      latitude: 37.75043,\
      longitude: -122.34679,\
      pitch: 0,\
      zoom: 9,\
      isSplit: false,\
      isViewportSynced: true,\
      isZoomLocked: false,\
      splitMapViewports: [],\
      mapViewMode: "MODE_2D",\
      mapSplitMode: "SINGLE_MAP",\
      globe: {\
        enabled: false,\
        config: {\
          atmosphere: true,\
          azimuth: false,\
          azimuthAngle: 45,\
          terminator: true,\
          terminatorOpacity: 0.35,\
          basemap: true,\
          labels: false,\
          labelsColor: [\
            114.75,\
            114.75,\
            114.75\
          ],\
          adminLines: true,\
          adminLinesColor: [\
            40,\
            63,\
            93\
          ],\
          water: true,\
          waterColor: [\
            17,\
            35,\
            48\
          ],\
          surface: true,\
          surfaceColor: [\
            9,\
            16,\
            29\
          ]\
        }\
      }\
    },\
    mapStyle: {\
      styleType: "dark",\
      topLayerGroups: {},\
      visibleLayerGroups: {\
        label: true,\
        road: true,\
        border: false,\
        building: true,\
        water: true,\
        land: true,\
        3d building: false\
      },\
      threeDBuildingColor: [\
        9.665468314072013,\
        17.18305478057247,\
        31.1442867897876\
      ],\
      backgroundColor: [\
        255,\
        255,\
        255\
      ],\
      mapStyles: {}\
    }\
  }\
```\
\
```python\
map.set_map_config({\
  "version": "v1",\
  "config": {\
    "visState": {\
      "filters": [],\
      "layers": [],\
      "interactionConfig": {\
        "tooltip": {\
          "fieldsToShow": {},\
          "compareMode": False,\
          "compareType": "absolute",\
          "enabled": True\
        },\
        "brush": {\
          "size": 0.5,\
          "enabled": False\
        },\
        "geocoder": {\
          "enabled": False\
        },\
        "coordinate": {\
          "enabled": False\
        }\
      },\
      "layerBlending": "normal",\
      "overlayBlending": "normal",\
      "splitMaps": [],\
      "animationConfig": {\
        "currentTime": null,\
        "speed": 1\
      },\
      "editor": {\
        "features": [],\
        "visible": True\
      },\
      "metrics": [],\
      "geoKeys": [],\
      "groupBys": [],\
      "datasets": {\
        "fieldDisplayNames": {},\
        "fieldDisplayFormats": {},\
        "datasetColors": {}\
      },\
      "joins": [],\
      "analyses": [],\
      "charts": []\
    },\
    "mapState": {\
      "bearing": 0,\
      "dragRotate": False,\
      "latitude": 37.75043,\
      "longitude": -122.34679,\
      "pitch": 0,\
      "zoom": 9,\
      "isSplit": False,\
      "isViewportSynced": True,\
      "isZoomLocked": False,\
      "splitMapViewports": [],\
      "mapViewMode": "MODE_2D",\
      "mapSplitMode": "SINGLE_MAP",\
      "globe": {\
        "enabled": False,\
        "config": {\
          "atmosphere": True,\
          "azimuth": False,\
          "azimuthAngle": 45,\
          "terminator": True,\
          "terminatorOpacity": 0.35,\
          "basemap": True,\
          "labels": False,\
          "labelsColor": [\
            114.75,\
            114.75,\
            114.75\
          ],\
          "adminLines": True,\
          "adminLinesColor": [\
            40,\
            63,\
            93\
          ],\
          "water": True,\
          "waterColor": [\
            17,\
            35,\
            48\
          ],\
          "surface": True,\
          "surfaceColor": [\
            9,\
            16,\
            29\
          ]\
        }\
      }\
    },\
    "mapStyle": {\
      "styleType": "dark",\
      "topLayerGroups": {},\
      "visibleLayerGroups": {\
        "label": True,\
        "road": True,\
        "border": False,\
        "building": True,\
        "water": True,\
        "land": True,\
        "3d building": False\
      },\
      "threeDBuildingColor": [\
        9.665468314072013,\
        17.18305478057247,\
        31.1442867897876\
      ],\
      "backgroundColor": [\
        255,\
        255,\
        255\
      ],\
      "mapStyles": {}\
    }\
  }\
```\
\
* * *\
\
## setMapControlVisibility   [Skip link to setMapControlVisibility](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setmapcontrolvisibility)\
\
_Python: `set_map_control_visibility`_\
\
JavaScriptPython\
\
```javascript\
setMapControlVisibility(\
  visibility: Partial<MapControlVisibility>\
): MapControlVisibility;\
```\
\
```python\
def set_map_control_visibility(\
    self,\
    visibility: Union[PartialMapControlVisibility, Dict[str, bool]],\
) -> Optional[MapControlVisibility]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-27)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-44)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `visibility` | [`MapControlVisibility`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcontrolvisibility) | The new map control visibility settings. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-61)\
\
Returns a [`MapControlVisibility`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcontrolvisibility) object containing the updated map control visibility settings.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-26)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-8)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `visibility` | `Union[` [`MapControlVisibility`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcontrolvisibility)`, dict, None]` | MapControlVisibility model instance or a dict with the same attributes, all optional. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-7)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `legend` | `bool` | Whether the legend is visible. |\
| `toggle_3d` | `bool` | Whether the 3D toggle is visible. |\
| `split_map` | `bool` | Whether the split map button is visible. |\
| `map_draw` | `bool` | Whether the map draw button is visible. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-62)\
\
Returns a [`MapControlVisibility`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#mapcontrolvisibility) object containing the updated map control visibility settings.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-49)\
\
JavaScriptPython\
\
```javascript\
map.setMapControlVisibility({\
  legend: false,\
  map-draw: false,\
  split-map: true,\
  toggle-3d: false,\
  chart: false\
});\
```\
\
```python\
map.set_map_control_visibility(\
    PartialMapControlVisibility(\
      legend=False,\
      toggle_3d=True\
    )\
)\
```\
\
* * *\
\
## setSplitMode   [Skip link to setSplitMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setsplitmode)\
\
_Python: `set_split_mode`_\
\
Sets the split mode of the map.\
\
JavaScriptPython\
\
```javascript\
map.setSplitMode('swipe', {\
  layers: [['left_layer'], ['right_layer']],\
  isViewSynced: true,\
  isZoomSynced: true\
});\
```\
\
```python\
def set_split_mode(\
    self,\
    split_mode: Literal["single", "dual", "swipe"],\
    options: Union[PartialSplitModeContext, dict],\
) -> Optional[SplitModeDetails]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-28)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-45)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `splitMode` | [`SplitMode`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmodecontext) | Split map mode with associated layers. |\
| `options` | `Partial<` [`SplitModeContext`](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference#splitmodecontext)`>` | A set of options to use when setting the split mode. |\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-63)\
\
Returns a [SplitModeDetails](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmodedetails) object containing the updated split mode of the map along with its associated layers.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-27)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-9)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `split_mode_props` | [`SplitModeProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmodeprops) | Split map mode with associated layers. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-8)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `mode` | [`SplitMode`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmode) | Split map mode with associated layers. |\
| `layers` | [`SplitLayers`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitlayers) | Arrays with layer Ids per each post-split map section. |\
\
### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-64)\
\
Returns a [SplitModeProps](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#splitmodeprops) object containing the updated split mode of the map along with its associated layers, or null for\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-50)\
\
JavaScriptPython\
\
```javascript\
map.setSplitMode('swipe', {\
  layers: ['left_layer', 'right_layer'],\
  isViewSynced: true,\
  isZoomSynced: true\
});\
```\
\
```python\
map.set_split_mode(split_mode='dual', options=PartialSplitModeContext(\
    is_view_synced=True,\
    is_zoom_synced=False,\
))\
```\
\
* * *\
\
## setTheme   [Skip link to setTheme](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#settheme)\
\
_Python: `set_theme`_\
\
Sets the UI theme of the map.\
\
JavaScriptPython\
\
```javascript\
setTheme(\
  theme: ThemeUpdateProps\
): void;\
```\
\
```python\
def set_theme(\
    self,\
    preset: Optional[Literal["light", "dark"]] = None,\
    background_color: Optional[str] = None,\
) -> None\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-29)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-46)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `theme` | [`ThemeUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#themeupdateprops) | New UI theme settings. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-28)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-47)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `preset` | `ThemePresets` | A preset theme, either "light" or "dark" |\
| `background_color` | `string` | Optional. A background color. |\
\
#### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-51)\
\
JavaScriptPython\
\
```javascript\
map.setTheme({\
  preset: 'light',\
  options: {\
    backgroundColor: 'lightseagreen'\
  }\
});\
```\
\
```python\
map.set_theme(\
  preset="dark",\
  background_color="lightseagreen"\
)\
```\
\
* * *\
\
## setView   [Skip link to setView](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setview)\
\
_Python: `set_view`_\
\
Sets the view state of the map.\
\
JavaScriptPython\
\
```javascript\
setView(\
  view: Partial<View>\
): View;\
```\
\
```python\
def set_view(\
    self, view: Union[PartialView, Dict[str, Number]], *, index: int = 0\
) -> Optional[View]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-30)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-48)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `view` | [`View`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view) | Type encapsulating view properties. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-65)\
\
Returns the updated [View](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view) state object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-29)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-10)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `view` | `Union[` [`View`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view)`, dict, None]` | View model instance or a dict with the same attributes |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-9)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `latitude` | `number` | Longitude of the view center \[-180, 180\]. |\
| `longitude` | `number` | Latitude of the view center \[-90, 90\]. |\
| `zoom` | `number` | View zoom level \[0-22\]. |\
| `pitch` | `number` | View pitch value \[0-90\]. |\
| `bearing` | `number` | View bearing \[0-360\]. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-66)\
\
Returns the updated [View](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view) state object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-52)\
\
JavaScriptPython\
\
```javascript\
map.setView({\
  longitude: -118.8189,\
  latitude: 34.01207,\
  zoom: 10,\
  pitch: 0,\
  bearing: 0\
});\
```\
\
```python\
map.set_view(PartialView(\
    longitude = -118.8189,\
    latitude = 34.01207,\
    zoom = 10,\
    pitch = 0,\
    bearing = 0\
))\
```\
\
* * *\
\
## setViewLimits   [Skip link to setViewLimits](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setviewlimits)\
\
_Python: `set_view_limits`_\
\
Sets the view state of the map.\
\
JavaScriptPython\
\
```javascript\
setViewLimits(\
  viewLimits: Partial<ViewLimits>,\
  options?: SetViewLimitsOptions\
): ViewLimits;\
```\
\
```python\
def set_view_limits(\
    self,\
    view_limits: Union[PartialViewLimits, dict],\
    *,\
    index: int = 0,\
) -> Optional[ViewLimits]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-31)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-49)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `viewLimits` | `Partial<` [`ViewLimits`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#view)`>` | Type encapsulating view properties. |\
| `options` | [`SetViewLimitsOptions`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#setviewlimitsoptions) | A set of options to use when setting the view limit. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-67)\
\
Returns the updated [ViewLimits](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewlimits) state object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-30)\
\
#### Positional Arguments   [Skip link to Positional Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#positional-arguments-11)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `view_limits` | `Union[` [`ViewLimits`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewlimits)`, dict, None]` | ViewLimits model instance or a dict with the same attributes, all optional. |\
\
#### Keyword Arguments   [Skip link to Keyword Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#keyword-arguments-10)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `min_zoom` | `Number` | Minimum zoom of the map \[0-22\]. |\
| `max_zoom` | `Number` | Maximum zoom of the map \[0-22\]. |\
| `max_bounds` | [`Bounds`](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference#studio-map-sdk-types#bounds), `dict` | a Bounds object or a dict with the keys (`min_longitude`, `max_longitude`, `min_latitude`, `max_latitude`). |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-68)\
\
Returns the updated [ViewLimits](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewlimits) state object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-53)\
\
JavaScriptPython\
\
```javascript\
map.setViewLimits({\
  minZoom: 0,\
  maxZoom: 22,\
  maxBounds: {\
    minLongitude: -122.4845632122524,\
    maxLongitude: -121.7461580455235,\
    minLatitude: 37.49028773126059,\
    maxLatitude: 37.94131376494916\
  }\
});\
```\
\
```python\
map.set_view_limits(PartialViewLimits(\
    min_zoom=0,\
    max_zoom=22,\
    max_bounds=Bounds(\
        min_longitude=-122.4845632122524,\
        max_longitude=-121.7461580455235,\
        min_latitude=37.49028773126059,\
        max_latitude=37.94131376494916\
    )\
))\
```\
\
* * *\
\
## setViewMode   [Skip link to setViewMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setviewmode)\
\
_Python: `set_view_mode`_\
\
Sets the view mode of the map to either `"2d"`, `"3d"`, or `"globe"`.\
\
JavaScriptPython\
\
```javascript\
setViewMode(\
  viewMode: ViewMode\
): ViewMode;\
```\
\
```python\
def set_view_mode(\
    self,\
    view_mode: Literal["2d", "3d", "globe"],\
) -> Optional[Literal["2d", "3d", "globe"]]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-32)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-50)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `viewMode` | [`viewMode`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#videmode) | The view mode for the map, either `"2d"`, `"3d"`, or `"globe"`. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-69)\
\
Returns the updated [ViewMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewmode) state object.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-31)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-51)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `viewMode` | [`viewMode`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewmode) | The view mode for the map, either `"2d"`, `"3d"`, or `"globe"`. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-70)\
\
Returns the updated [ViewMode](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#viewmode) state object.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-54)\
\
JavaScriptPython\
\
```javascript\
map.setViewMode("3d");\
```\
\
```python\
map.set_view_mode("3d")\
```\
\
* * *\
\
## setViewFromConfig   [Skip link to setViewFromConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setviewfromconfig)\
\
_Python: `set_view_from_config`_\
\
Sets the entire view from the view JSON configuration.\
\
JavaScriptPython\
\
```javascript\
setViewFromConfig(\
  viewConfig: ViewConfig\
): void;\
```\
\
```python\
set_view_from_config(\
    self,\
    view_config: Union[Dict, str]\
) -> None:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-33)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-52)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `viewConfig` | [`ViewConfig`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#videmode) | JSON config of a view. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-32)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-53)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `view_config` | `Union[Dict, str]` (corresponds to `ViewConfig`) | JSON config of a view. |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-55)\
\
JavaScriptPython\
\
```javascript\
map.setViewFromConfig({\
  isSplit: false,\
  mapSplitMode: "SINGLE_MAP",\
  mapViewMode: "MODE_2D",\
  latitude: 37.3510537,\
  longitude: -14.755157,\
  zoom: 2.3,\
  pitch: 0,\
  bearing: 0\
});\
```\
\
```python\
map.set_view_from_config("""{\
  "isSplit": false,\
  "mapSplitMode": "SINGLE_MAP",\
  "mapViewMode": "MODE_2D",\
  "latitude": 37.3510537,\
  "longitude": -14.755157,\
  "zoom": 2.3,\
  "pitch": 0,\
  "bearing": 0\
}""")\
```\
\
* * *\
\
## setAnimationFromConfig   [Skip link to setAnimationFromConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#setanimationfromconfig)\
\
_Python: `set_animation_from_config`_\
\
Sets the animation properties from the animation JSON configuration.\
\
This function can configure animation to either of types of animation (layer and timeline type of animation).\
\
JavaScriptPython\
\
```javascript\
setAnimationFromConfig(\
  config: AnimationConfig\
): void;\
```\
\
```python\
set_animation_from_config(\
    self,\
    animation_config: Union[dict, str, Animation, FilterAnimation]\
) -> None:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-34)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-54)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `config` | `AnimationConfig` | JSON config for animation. |\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-33)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-55)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `animation_config` | `Union[dict, str, Animation, FilterAnimation]` JSON config for animation. |  |\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-56)\
\
JavaScriptPython\
\
```javascript\
map.setAnimationFromConfig({\
  currentTime: 123,\
  speed: 1.1,\
  domain: [100, 200],\
  timeFormat: 'L LTS'\
});\
```\
\
```python\
map.set_animation_from_config("""{\
    "currentTime": 1655251000,\
    "domain": [1655250000, 1655251000],\
    "speed": 1.2,\
    "timeFormat": "L LTS"\
}""")\
```\
\
* * *\
\
## updateEffect   [Skip link to updateEffect](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#updateeffect)\
\
_Python: `update_effect`_\
\
Updates a visual [post-processing effect](https://docs.foursquare.com/studio/docs/maps-effects) to the map.\
\
JavaScriptPython\
\
```javascript\
updateEffect(\
  effectId: string,\
  values: EffectUpdateProps\
): Effect;\
```\
\
```python\
def update_effect(\
    self,\
    effect_id: str,\
    values: Union[EffectUpdateProps, dict],\
) -> Optional[Effect]\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-35)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-56)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `effectId` | `string` | The ID for the effect to update. |\
| `values` | [`EffectUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effectupdateprops) | A set of properties used to update an effect. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-71)\
\
Returns the updated [`effect`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effect).\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-34)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| `effect_id` | `string` | The ID for the effect to update. |\
| `values` | [`EffectUpdateProps`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effectupdateprops) | A set of properties used to update an effect. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-72)\
\
Returns the updated [`effect`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#effect).\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-57)\
\
JavaScriptPython\
\
```javascript\
map.updateEffect({\
  id: "effect-id",\
  isEnabled: false,\
  parameters: {\
    shadowIntensity: 0.75,\
    shadowColor: [25, 50, 75]\
  },\
});\
```\
\
```python\
map.update_effect(\
    "effect-id",\
    values=EffectUpdateProps(\
        is_enabled=True,\
        parameters={"strength": 0.5}\
    ),\
)\
```\
\
# Interaction Functions   [Skip link to Interaction Functions](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#interaction-functions)\
\
* * *\
\
## setTooltipConfig   [Skip link to setTooltipConfig](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#settooltipconfig)\
\
Sets the configuration of the mouse-over tooltip on the map.\
\
> 📝\
>\
> ### Note:   [Skip link to Note:](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#note-2)\
>\
> You can modify the tooltip configuration only for datasets already added to the map.\
\
JavaScriptPython\
\
```javascript\
setTooltipConfig: (\
    config: TooltipInteractionConfig\
) => TooltipInteractionResponse;\
```\
\
```python\
def set_tooltip_config(\
    self, tooltip_interaction_config: TooltipInteractionConfig\
) -> Optional[TooltipInteractionResponse]:\
```\
\
### Javascript   [Skip link to Javascript](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#javascript-36)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-57)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| \[`config`\] | [`TooltipInteractionConfig`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#tooltipinteractionconfig) | The tooltip config for each dataset. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-73)\
\
_Widget map only._\
\
Returns the [TooltipInteractionResponse](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#tooltipinteractionresponse) object that was added to the map.\
\
### Python   [Skip link to Python](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#python-35)\
\
#### Arguments   [Skip link to Arguments](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#arguments-58)\
\
| Argument | Type | Description |\
| --- | --- | --- |\
| \[`tooltip_interaction_config`\] | [`TooltipInteractionConfig`](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#tooltipinteractionconfig), `dict` | The tooltip config for each dataset. |\
\
#### Returns   [Skip link to Returns](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#returns-74)\
\
Returns the [TooltipInteractionResponse](https://docs.foursquare.com/developer/docs/studio-map-sdk-types#tooltipinteractionresponse) response object indicating if\
\
tooltip is enabled.\
\
### Examples   [Skip link to Examples](https://docs.foursquare.com/developer/docs/studio-map-sdk-api-reference\#examples-58)\
\
JavaScriptPython\
\
```javascript\
map.setTooltipConfig({\
  enabled: true,\
  tooltipConfig: {\
      fieldsToShow: {\
        compareType: "relative",\
        compareMode: true,\
        "datasetId1": [{\
            name: "lat",\
            format: null\
        }, {\
            name: "lon",\
            format: null\
        }],\
        "datasetId2": [{\
            name: "datasetColumnName",\
            format: null\
        }]\
      }\
  },\
})\
```\
\
```python\
map.set_tooltip_config(map.TooltipInteractionConfig(\
    enabled=True,\
    tooltip_config=map.TooltipConfig(\
        compare_type="relative",\
        compare_mode=True\
        fields_to_show={\
            "datasetId1": [\
                map_sdk.TooltipField(name = "lat"),\
                map_sdk.TooltipField(name = "lon"),\
            ],\
            "datasetId2: [\
                map_sdk.TooltipField(name = "cdeldatasetColumnNameigibil"),\
            ]\
        }\
    )\
))\
```\
\
* * *\
\
Updated5 months ago\
\
* * *\
\
Did this page help you?\
\
Yes\
\
No\
\
\
\
Ask AI\
\
reCAPTCHA\
\
Recaptcha requires verification.\
\
protected by **reCAPTCHA**