Examples of integrating GoodData analytics with popular mapping libraries using React, TypeScript, and Vite.
- Node.js 18+ (managed via
nvm use) - React 18.3
- TypeScript 5
- Vite 5 (dev server & bundler)
- GoodData Cloud workspace with location attributes (latitude/longitude display forms)
- GoodData SDK for data extraction
- Various mapping libraries (see Available integrations)
| Service | API Key Required | Free to use | Notes |
|---|---|---|---|
| GoodData Geo | No | ✅ | Part of GoodData license Uses GoodData's GeoPushpinChart component |
| Leaflet | No | ✅ | Uses free OpenStreetMap Lightweight, mobile-friendly open-source |
| OpenLayers | No | ✅ | Uses free OpenStreetMap Powerful open-source library with advanced features. |
| MapBox | Yes | 50k loads/month | MapBox Pricing Professional mapping service with beautiful styles |
| MapTiler | Yes | 100k tiles/month | MapTiler Pricing multiple visualization modes (based on MapLibre) |
| MapLibre | No | ✅ | Uses free OpenStreetMap |
-
Clone and install dependencies:
# Install in root npm install # Or in specific integration cd leaflet && npm install
-
Configure environment:
cp .env.template .env
Edit
.envin the root folder:VITE_BACKEND=https://your-gooddata-instance.com VITE_WORKSPACE=your_workspace_id VITE_TIGER_API_TOKEN=your_api_token # For MapBox (optional) VITE_MAPBOX_TOKEN=your_mapbox_token # For MapTiler (optional) VITE_MAPTILER_TOKEN=your_maptiler_token
-
Update catalog (for live data):
cd leaflet # or any integration npm run refresh-md
-
Start development server:
npm start
-
Open browser:
- Default: http://localhost:5173 (or port shown in terminal)
Your GoodData workspace needs location attributes with geo display forms:
// Example: CustomerCity attribute
{
Default: "City Name",
CityPushpinLatitude: "40.7128",
CityPushpinLongitude: "-74.0060"
}- Navigate to Data → Attributes
- Select your location attribute
- Add display forms with Geo Pushpin type
- Map to latitude/longitude columns
gooddata-map-integrations/
├── .env # Environment config (create from .env.template)
├── gooddata/ # GoodData native component
├── leaflet/ # Leaflet integration
├── mapbox/ # MapBox integration
├── mapcn/ # MapLibre GL JS integration
├── maptiler/ # MapTiler integration
└── openlayers/ # OpenLayers integration
Each integration follows a similar structure:
integration/
├── src/
│ ├── example/
│ │ ├── Example.tsx # Main component
│ │ ├── *DataLoader.tsx # GoodData data fetching
│ │ ├── *Map.tsx # Map rendering
│ │ └── *MapDemo.tsx # Demo with sample data
│ ├── App.tsx # React app wrapper
│ ├── backend.ts # GoodData backend config
│ └── catalog.ts # Generated semantic model
└── package.json
All integrations use GoodData's execution API with display forms:
import { useExecutionDataView } from "@gooddata/sdk-ui";
const execution = backend
.workspace(workspace)
.execution()
.forItems([
Md.CustomerCity.Default, // City name
Md.CustomerCity.CityPushpinLatitude, // Latitude
Md.CustomerCity.CityPushpinLongitude, // Longitude
Md.TotalCustomers, // Measure
])
.withDimensions(...);
const { result } = useExecutionDataView({ execution });- ✅ Interactive markers with popups
- ✅ Dynamic coloring based on values
- ✅ Auto-centering on data bounds
- ✅ Demo mode (works without GoodData)
- ✅ Error handling and loading states
- Carto - Another interesting mapping option
(C) 2017-2026 GoodData Corporation
This repository is under the GoodData commercial license available in the LICENSE file.