Skip to main content
Version: Next

Map Configuration API

At the top level, the Foursquare Studio map configuration object contains a version string and an object with map state, map style and visualizaton state.

Note that a map configuration does not contain the actual data in the map, just configuration information for the visual and interactive aspects of the map. Rendering of a map typically requires both a map configuration and one or more associated datasets.

Set the map configuration

Using setMapConfig(...) function you can pass a new Map Configuration object.

setMapConfig(config: MapConfig): void
interface MapConfig {
version: string;
config: {
mapState: any;
mapStyle: any;
visState: any;
};
}

Parameters

At the top level, the Foursquare Studio map configuration object contains a version string and an object with map state, map style and visualizaton state.

Note that a map configuration does not contain the actual data in the map, just configuration information for the visual and interactive aspects of the map. Rendering of a map typically requires both a map configuration and one or more associated datasets.

Map State

The map state contains the current view of the map (location, zoom, tilt) as well as the various view (2D, 3D, Globe, split screen etc) and base map settings.

The config.mapState object can have the following fields:

Map Style

The config.mapStyle object can have the following fields:

Vis State

The visualization state contains the configuration of the map visualization, which includes:

  • Layers (official docs)
  • Filters
  • Joins
  • Metrics
  • Interaction settings
  • General visualization settings

The following fields can be added to config.visState:

Layers

Get the map configuration

Using getMapConfig(...) function you can get the map configuration object that contains mapState, mapStyle, and visState object properties.

getMapConfig(): Promise<MapConfig>
interface MapConfig {
version: string;
config: {
mapState: any;
mapStyle: any;
visState: any;
};
}

You can use this Text Area input field to get the latest map configuration and apply your changes: