Configuration
- sectionType: maps
containerTag: section
mapProvider: 'leaflet'
mapData: 'london-landmarks'
height: '500px'
text:
leadIn: 'Interactive Mapping'
title: Explore London Landmarks
titleTag: 'h2'
subTitle: 'Discover famous locations across the city'
prose: Interactive maps provide engaging ways to showcase locations, whether for business directories, travel guides, or event venues...
ctas:
- url: 'https://leafletjs.com'
label: 'Learn More'
isButton: true
buttonStyle: 'primary'
Notes
- Dynamic library loading, custom SVG markers, interactive popups, marker clustering
- Responsive design across all devices with accessibility features for screen readers
- Multiple maps per page with independent configurations and provider selection
- All text fields and CTAs are optional
- Maps automatically adapt to container dimensions
Page Frontmatter (UI Configuration):
Property | Type | Description |
---|
mapProvider | string | Map library to use ('leaflet' or 'openlayers') |
mapData | string | Reference to JSON file in lib/data/maps/ (e.g., 'london-landmarks') |
height | string | Optional custom map height (e.g., '500px', '50vh') - defaults to 400px |
text | object | Standard text block with leadIn, title, subtitle, and prose |
ctas | array | Array of call-to-action buttons or links |
JSON Data File (Map Content):
Property | Type | Description |
---|
latitude /longitude | number | Map center coordinates |
zoom | number | Initial zoom level |
clustering | object | Optional clustering configuration object |
markers | array | Array of marker objects with coordinates and popup content |
JSON Data Structure
Map data is stored in /lib/data/maps/{mapData}.json
files with the following structure:
{
"latitude": 51.509865,
"longitude": -0.118092,
"zoom": 10,
"clustering": {
"enabled": true,
"maxZoom": 15,
"radius": 50,
"minClusterSize": 2,
"style": {
"backgroundColor": "#4285f4",
"textColor": "#ffffff",
"borderColor": "#1976d2",
"borderWidth": 2
}
},
"markers": [
{
"latitude": 51.509865,
"longitude": -0.118092,
"title": "London",
"icon": "star",
"content": {
"title": "London",
"body": "Description text...",
"link": "https://example.com"
}
}
]
}