Geo Chart

A geo chart visualizes data on a map using one or more layers. You can compose pushpin layers (point data) and area layers (region data) into a single visualization.

Structure

import "@gooddata/sdk-ui-geo/styles/css/main.css";
import { GeoChart, createAreaLayer, createPushpinLayer } from "@gooddata/sdk-ui-geo";

<GeoChart
    layers={[
        createPushpinLayer({
            latitude: <attribute>,
            longitude: <attribute>,
            size: <measure>,
            color: <measure>,
            segmentBy: <attribute>,
        }),
        createAreaLayer({
            area: <attribute>,
            color: <measure>,
        }),
    ]}
    config={<geo-chart-config>}
    filters={<filters>}
/>

Example

import "@gooddata/sdk-ui-geo/styles/css/main.css";
import { GeoChart, createAreaLayer, createPushpinLayer } from "@gooddata/sdk-ui-geo";
import * as Md from "./md/full";

const layers = [
    createAreaLayer({
        area: Md.Country.Name,
        color: Md.Revenue.Sum,
    }),
    createPushpinLayer({
        latitude: Md.City.Latitude,
        longitude: Md.City.Longitude,
        size: Md.Population.Sum,
        tooltipText: Md.City.Name,
    }),
];

const config = {
    viewport: {
        area: "continent_eu",
    },
    points: {
        groupNearbyPoints: true,
    },
    areas: {
        fillOpacity: 0.5,
    },
    cooperativeGestures: true,
};

<div style={{ height: 600, width: 900 }}>
    <GeoChart layers={layers} config={config} onBoundsChanged={(bounds) => console.log("Bounds:", bounds)} />
</div>;

Properties

NameRequired?TypeDescription
layerstrueIGeoLayer[]Array of layer definitions rendered in order. The first layer is the primary layer and drives legend and drilling behavior
typefalseGeoLayerTypeVisualization type reported through pushData callbacks. Defaults to the primary layer type
configfalseIGeoChartConfigUnified geo chart configuration
filtersfalseNullableFiltersOrPlaceholdersGlobal filters applied to every layer execution
backendfalseIAnalyticalBackendBackend used for data execution
workspacefalsestringWorkspace identifier
localefalsestringLocale used for UI localization. Defaults to en-US
drillableItemsfalseExplicitDrill[]Drill configuration for points and attribute values
ErrorComponentfalseComponentTypeComponent rendered when the visualization is in an error state
LoadingComponentfalseComponentTypeComponent rendered while the visualization is loading
onErrorfalseOnErrorCallback fired when loading or rendering fails
onExportReadyfalseOnExportReadyCallback fired when export functions become available
onLoadingChangedfalseOnLoadingChangedCallback fired when the loading state changes
onDrillfalseOnFiredDrillEventCallback fired when drilling is triggered
onCenterPositionChangedfalseCenterPositionChangedCallbackCallback fired when the map center changes
onZoomChangedfalseZoomChangedCallbackCallback fired when the map zoom level changes
onBoundsChangedfalseBoundsChangedCallbackCallback fired when the visible map bounds change
onViewportInteractionEndfalseViewportInteractionEndCallbackCallback fired when a user-triggered viewport interaction finishes

Layers

Layers are typically created using createPushpinLayer(layer, id?) and createAreaLayer(layer, id?). Each layer runs its own independent data execution. The optional second argument lets you set a custom layer id. If you do not use the factory helpers, each layer object must include a unique id and a type.

Common layer properties

These properties are shared by both pushpin and area layer definitions:

NameRequired?TypeDescription
namefalsestringHuman-readable layer name
colorfalseIAttributeOrMeasureMeasure-based gradient or attribute-based categorical color encoding
segmentByfalseIAttributeAttribute for categorical grouping with distinct colors
configfalseIGeoLayerConfigPer-layer color configuration: { colorPalette?: IColorPalette, colorMapping?: IColorMapping[] }
filtersfalseINullableFilter[]Filters specific to this layer’s data execution
sortByfalseISortItem[]Sorting for this layer’s data execution
tooltipTextfalseIAttributeAttribute whose values are shown in tooltips

Pushpin Layer

Created with createPushpinLayer(). Renders point data as markers on the map.

NameRequired?TypeDescription
latitudetrueIAttributeAttribute containing latitude values (decimal degrees, -90 to 90)
longitudetrueIAttributeAttribute containing longitude values (decimal degrees, -180 to 180)
sizefalseIAttributeOrMeasureMeasure or attribute used for marker size scaling
measuresfalseIAttributeOrMeasure[]Additional measures shown in tooltips only
geoIconfalseIAttributeAttribute whose display form type is GDC.geo.icon. Used with config.points.shapeType: "iconByValue"

Area Layer

Created with createAreaLayer(). Renders geographic regions as filled polygons (choropleth map).

NameRequired?TypeDescription
areatrueIAttributeAttribute whose values represent geographic regions (countries, states, provinces, and similar regions)

Layer filter semantics

Layer-specific filters are applied before global component-level filters. When both are provided, the global filters take precedence for filter types with “last wins” merge rules (e.g. date filters for the same dataset).

Geo Config

The config prop accepts an IGeoChartConfig object.

NameRequired?TypeDescription
centerfalseIGeoLngLatInitial map center. Defaults to auto-centering based on data
zoomfalsenumberInitial zoom level in the 0-22 range. Defaults to auto-fit
boundsfalseIGeoLngLatBoundsBounding box for a custom viewport. Takes priority over center and zoom
isExportModefalsebooleanExport mode that disables gestures and preserves the drawing buffer
legendfalseIGeoChartLegendConfigLegend configuration
limitfalsenumberMaximum number of rendered data points
mapStylefalsestring | StyleSpecificationCustom MapLibre style URL or inline style specification
basemapfalseGeoBasemapAlpha. Basemap style identifier such as "standard-light" or "satellite"
maxZoomLevelfalsenumber | nullMaximum zoom level. undefined keeps the default, null removes the limit
separatorsfalseISeparatorsCustom number separators used for formatting
viewportfalseIGeoChartViewportViewport preset or advanced navigation configuration
pointsfalseIGeoChartPointsConfigConfiguration for pushpin markers (clustering, sizing, shape type)
areasfalseIGeoAreasConfigConfiguration for area layer styling (opacity, borders)
colorsfalsestring[]Simple color palette expressed as CSS color strings
colorPalettefalseIColorPaletteStructured color palette compatible with color mapping GUIDs
colorMappingfalseIColorMapping[]Explicit color mapping overrides
showLabelsfalsebooleanDisplays data labels on the map when supported
cooperativeGesturesfalsebooleanWhen true, requires Ctrl/Cmd + scroll to zoom (useful inside scroll containers)

For additional examples of colors, separators, or legend behavior, see Chart Config.

Points Config

NameRequired?TypeDescription
minSizefalseGeoChartPushpinSizeOptionMinimum marker size option: "0.5x" | "0.75x" | "normal" | "1.25x" | "1.5x" | "default"
maxSizefalseGeoChartPushpinSizeOptionMaximum marker size option: "0.5x" | "0.75x" | "normal" | "1.25x" | "1.5x" | "default"
groupNearbyPointsfalsebooleanGroups nearby points into clusters. Defaults to false.
shapeTypefalseGeoChartShapeTypeMarker shape: "circle" (default), "iconByValue" (icon from a geoIcon attribute), or "oneIcon" (static icon from a sprite sheet)
iconfalsestringSprite sheet icon name. Required when shapeType is "oneIcon".

Areas Config

NameRequired?TypeDescription
fillOpacityfalsenumberOpacity of filled areas (0–1). Default: 0.7.
borderColorfalsestringColor of area borders. Default: "#FFFFFF".
borderWidthfalsenumberWidth of area borders in pixels. Default: 1.

Viewport Config

NameRequired?TypeDescription
areafalseIGeoChartViewportAreaViewport preset: "auto" (default) | "custom" | "world" | "continent_af" | "continent_as" | "continent_au" | "continent_eu" | "continent_na" | "continent_sa"
frozenfalsebooleanLocks user interaction (pan and zoom) when true. Defaults to false.
navigationfalseIGeoChartViewportNavigationFine-grained control: { pan?: boolean, zoom?: boolean }. Defaults to both true.

Legend Config

NameRequired?TypeDescription
enabledfalsebooleanEnables legend rendering. Defaults to true.
positionfalseGeoLegendPosition | LegacyGeoLegendPosition"auto" (default), "top-left", "top-right", "bottom-left", or "bottom-right". Legacy edge values are deprecated.
responsivefalseboolean | "autoPositionWithPopup"true enables responsive legend layout. Legacy "autoPositionWithPopup" preserves older automatic legend placement behavior in smaller containers. Defaults to false.

Notes

  • Use GeoPushpinChart or GeoAreaChart if you only need a single layer.
  • The first layer in the layers array is the primary layer — it drives the legend and drilling behavior.
  • Each layer executes independently and can have its own filters, sorting, and color configuration.
  • For full API documentation, see the TypeScript definitions.