Performance & Implementation
JSON Data Architecture: Map content is stored in external JSON files in/lib/data/maps/, keeping page frontmatter clean while supporting complex datasets with many markers.
Dynamic Loading: The component loads the appropriate mapping library (Leaflet v1.9.4 or OpenLayers v10.3.0) from CDN only when needed. This keeps your initial bundle size small.
Provider Switching: You can easily switch between Leaflet and OpenLayers by changing just themapProviderfield. The same JSON data file works with both providers.
Data Reusability: The same JSON data file can be referenced by multiple pages, making it easy to maintain consistent map content across your site.
Build-time Icon Registry: Icons are automatically scanned from JSON files and included in the build only when used, optimizing bundle size.
Multiple Maps: You can have multiple maps on the same page using different providers and different JSON data files. Each map maintains its own state and configuration.
Consistent SVG Markers: Both providers use the same custom SVG marker design for visual consistency across all maps.
Responsive Design: Maps automatically adapt to their container width and include mobile-optimized touch interactions.
Accessibility: Markers include proper title attributes for screen readers, and all external links include appropriate security attributes.