Implementing Syncfusion React Maps
A comprehensive skill for implementing the Syncfusion React Maps component to visualize geographical data with rich interactivity, multiple layers, markers, bubbles, legends, and map provider integration.
When to Use This Skill
Use this skill when you need to:
- Display geographical data on interactive maps
- Visualize location-based information with markers, bubbles, or data labels
- Create choropleth maps with color-coded regions based on data values
- Integrate map providers like Bing Maps, OpenStreetMap, or Azure Maps
- Render custom shapes from GeoJSON data files
- Build multi-layer maps with overlays and sublayers
- Add navigation lines to show routes or connections between locations
- Implement zooming and panning for map exploration
- Display statistical data on geographical regions
- Create interactive legends for data interpretation
- Support multiple projections (Mercator, Miller, Eckert, etc.)
- Handle user interactions like tooltips, selection, and highlighting
Component Overview
The Syncfusion React Maps component is a powerful data visualization tool that renders geographical data using Scalable Vector Graphics (SVG). It supports:
- Any number of layers and sublayers for complex visualizations
- GeoJSON data binding for custom shape rendering
- Map providers (Bing, OpenStreetMap, Azure) as base layers
- 6 types of projections for different map representations
- Visual elements: Markers, Bubbles, Navigation Lines, Annotations, Data Labels, Legends
- Interactive features: Zooming, Panning, Tooltips, Selection, Highlighting
- Accessibility: WCAG 2.1 compliant with keyboard navigation
- Globalization: RTL support, internationalization, localization
Key Capabilities
Data Visualization Elements
- Markers: Pin locations with custom shapes, templates, and clustering
- Bubbles: Display data magnitude with size-based bubbles
- Data Labels: Show information directly on map shapes
- Color Mapping: Apply colors based on data values (equal, range, desaturation)
- Navigation Lines: Draw connections between locations with curves and arrows
- Legends: Provide visual keys for data interpretation
Layer Architecture
- Main Layer: Base map from GeoJSON or map provider
- Sublayers: Overlay additional shapes on top of main layer
- Multi-layer Support: Stack multiple layers for rich visualizations
Map Providers
- Bing Maps: Satellite, aerial, and road views
- OpenStreetMap: Free tile layer provider
- Azure Maps: Microsoft's map service
- Hybrid Approach: Combine GeoJSON shapes with provider tiles
User Interactions
- Zooming: Mouse wheel, double-click, pinch, toolbar controls
- Panning: Drag to explore different regions
- Tooltips: Show data on hover
- Selection: Highlight shapes on click
- Reset: Return to initial view
Documentation and Navigation Guide
API Reference
📄 Read: references/api-reference.md
- Complete MapsComponent properties reference
- All available methods with examples
- Comprehensive events documentation
- Layer, marker, bubble, and data label settings
- Legend, zoom, and tooltip configuration
- Quick reference code examples
- Type definitions and parameters
Getting Started
📄 Read: references/getting-started.md
- Installation and package dependencies
- Basic Maps component implementation
- GeoJSON data structure and binding
- CSS theme imports
- Module injection pattern (feature-based)
- First world map example
- Data source binding with shapeDataPath and shapePropertyPath
Layers and Structure
📄 Read: references/layers-and-sublayers.md
- Understanding layer architecture
- Main layer vs sublayer differences
- Creating multi-layer maps
- Layer types and stacking order
- Layer-specific settings and configuration
- When to use multiple layers
Markers
📄 Read: references/markers.md
- Adding markers to pinpoint locations
- Marker data source structure (latitude, longitude)
- Marker shapes and custom templates
- Marker clustering for dense data
- Dynamic marker updates
- Interactive markers with click events
- Marker tooltips and labels
Data Visualization Elements
📄 Read: references/data-visualization.md
- Bubble visualization for data magnitude
- Configuring bubble size and colors
- Data label setup and formatting
- Smart label modes (trim, hide, none)
- Label templates for custom content
- Combining bubbles with data labels
- Best practices for visual hierarchy
Legend
📄 Read: references/legend.md
- Enabling and configuring legends
- Positioning strategies (absolute, dock)
- Legend alignment options (near, center, far)
- Interactive legends
- Legend modes (default, interactive)
- Customizing legend appearance
- Syncing legends with color mapping
Color Mapping
📄 Read: references/color-mapping.md
- Color mapping types (equal, range, desaturation)
- Applying colors based on data values
- Setting up colorValuePath
- Creating choropleth maps
- Multiple color mapping rules
- Custom color schemes
- Visual data representation strategies
Navigation Lines
📄 Read: references/navigation-lines.md
- Creating lines between locations
- Line styling (width, color, dash array)
- Curved lines and angles
- Arrow indicators for direction
- Use cases (routes, connections, flows)
- Animation effects on lines
Map Providers
📄 Read: references/map-providers.md
- Overview of supported providers
- When to use GeoJSON vs map providers
- Bing Maps setup and API keys
- OpenStreetMap integration (free)
- Azure Maps configuration
- Tile layer types (satellite, aerial, road)
- Hybrid approaches (GeoJSON overlays on provider tiles)
User Interactions
📄 Read: references/user-interactions.md
- Enabling and configuring zooming
- Zoom factor and toolbar controls
- Panning functionality
- Tooltip configuration and templates
- Selection and highlighting shapes
- Mouse wheel and double-click zoom
- Pinch zoom for touch devices
- Reset to initial view
Annotations and Polygons
📄 Read: references/annotations-polygon.md
- Adding custom annotations to maps
- Polygon rendering for custom shapes
- Positioning and alignment
- Interactive annotations
- Use cases for overlays
Customization
- Map projections (Mercator, Miller, Eckert, Winkel Tripel, Aitoff, Equirectangular)
- Title and subtitle configuration
- Border and background styling
- Margin and padding adjustments
- Custom CSS classes
- Theme integration
- Responsive design patterns
Advanced Features
📄 Read: references/advanced-features.md
- Internationalization (i18n)
- Localization (l10n)
- Accessibility (WCAG compliance, keyboard navigation)
- State persistence across sessions
- Printing and export functionality
- Event handling patterns
- Accessing component methods via ref
- Performance optimization techniques
- Migration guide from EJ1 to EJ2
Quick Start Example
import * as React from 'react';
import { MapsComponent, LayersDirective, LayerDirective, Inject, Legend } from '@syncfusion/ej2-react-maps';
import { world_map } from './world-map'; // GeoJSON data
function MapExample() {
const data = [
{ Country: 'United States', Population: 331000000, Membership: 'Permanent' },
{ Country: 'Russia', Population: 145900000, Membership: 'Permanent' },
{ Country: 'China', Population: 1439000000, Membership: 'Permanent' },
{ Country: 'India', Population: 1380000000, Membership: 'Non-Permanent' },
{ Country: 'Brazil', Population: 212500000, Membership: 'Non-Permanent' }
];
return (
<MapsComponent
titleSettings={{ text: 'World Map with Country Membership' }}
legendSettings={{ visible: true }}
>
<Inject services={[Legend]} />
<LayersDirective>
<LayerDirective
shapeData={world_map}
shapeDataPath='Country'
shapePropertyPath='name'
dataSource={data}
shapeSettings={{
colorValuePath: 'Membership',
colorMapping: [
{ value: 'Permanent', color: '#D84444' },
{ value: 'Non-Permanent', color: '#316DB5' }
]
}}
/>
</LayersDirective>
</MapsComponent>
);
}
export default MapExample;
Module Injection Guide
Maps features are modular. Inject only the modules you need:
import {
MapsComponent,
Inject,
Legend, // For legends
DataLabel, // For data labels
Marker, // For markers
Bubble, // For bubbles
MapsTooltip, // For tooltips
Zoom, // For zooming and panning
Highlight, // For highlighting shapes
Selection, // For selecting shapes
NavigationLine,// For navigation lines
Annotations, // For annotations
Polygon // For polygons
} from '@syncfusion/ej2-react-maps';
<MapsComponent>
<Inject services={[Legend, Marker, MapsTooltip, Zoom]} />
{/* Your layers */}
</MapsComponent>
Only inject modules for features you're using to minimize bundle size.
Common Use Cases
Choropleth Map (Color-Coded Regions)
Goal: Display statistical data with color-coded countries/regions
Approach:
- Bind data source with
dataSource, shapeDataPath, shapePropertyPath
- Configure
shapeSettings.colorValuePath to specify data field
- Set up
colorMapping with value-color pairs
- Add
Legend for interpretation
Example: Population density map, election results, COVID-19 statistics
Location Markers Map
Goal: Show specific locations with custom markers
Approach:
- Add
MarkersDirective inside LayerDirective
- Provide marker data with latitude/longitude
- Customize marker shapes, sizes, and templates
- Add tooltips for marker information
Example: Store locator, branch offices, tourist attractions
Multi-Layer Overlay
Goal: Highlight specific regions on a base map
Approach:
- First layer: Base map (e.g., entire country)
- Additional layers with
type="SubLayer": Highlighted regions
- Style sublayers distinctly (different colors, borders)
- Control layer visibility and order
Example: State highlights on country map, sales regions
Route Visualization
Goal: Show connections or routes between locations
Approach:
- Add markers for start/end points
- Use
NavigationLineDirective to draw lines
- Configure line curves, arrows, and styling
- Optionally animate lines
Example: Flight routes, shipping lanes, migration patterns
Map Provider Integration
Goal: Use real-world satellite/street map as base
Approach:
- Configure layer with
urlTemplate for provider
- Set up API keys (Bing, Azure) if required
- Overlay GeoJSON shapes as sublayers if needed
- Add markers and labels on top
Example: Real estate map, delivery tracking, ride-sharing app
Decision Trees
Should I Use GeoJSON or Map Provider?
Use GeoJSON when:
- You need custom shapes or boundaries
- Data is region/country-based (choropleth maps)
- No real-world street-level detail needed
- Offline capability required
- Full control over styling and data binding
Use Map Provider when:
- Need real-world satellite/aerial imagery
- Street-level detail required
- Real-time map updates desired
- Users expect familiar map interface (like Google Maps)
Use Both (Hybrid) when:
- Need real-world base with custom shape overlays
- Combining statistical regions with street context
Which Color Mapping Type?
Equal Color Mapping:
- Use when data has discrete categories (e.g., Membership: Permanent/Non-Permanent)
- Each unique value gets a specific color
Range Color Mapping:
- Use when data is numeric and continuous (e.g., Population: 0-1M, 1M-10M, 10M+)
- Values within ranges get assigned colors
Desaturation Color Mapping:
- Use for gradient effects based on numeric values
- Single color with varying saturation levels
How Many Layers Should I Use?
Single Layer:
- Simple visualizations with one data dimension
- Basic country/region maps
- When all data fits one layer
Multiple Layers:
- Highlighting specific regions on base map
- Combining different data sources
- Creating visual depth with overlays
- Showing borders, rivers, cities separately
Key Props Reference
MapsComponent
titleSettings: Configure title and subtitle
legendSettings: Legend visibility, position, alignment
zoomSettings: Enable zooming, set initial zoom factor
layers: Array of layer configurations
LayerDirective
shapeData: GeoJSON data for shapes
dataSource: Data to bind to shapes
shapeDataPath: Field in dataSource matching shapes
shapePropertyPath: Field in GeoJSON matching dataSource
shapeSettings: Fill, border, color mapping
type: "Layer" (main) or "SubLayer" (overlay)
markerSettings: Marker configurations
bubbleSettings: Bubble visualizations
dataLabelSettings: Label configurations
tooltipSettings: Tooltip customization
navigationLineSettings: Line visualizations
Common Patterns
- Module Injection: Only inject needed services to reduce bundle size
- Data Binding: Use shapeDataPath + shapePropertyPath for automatic matching
- Progressive Enhancement: Start with basic map, add features incrementally
- Responsive Design: Maps auto-resize, but test on different viewports
Troubleshooting Quick Checks
❌ Map not displaying:
- Verify GeoJSON data is correctly imported
- Check console for errors
- Ensure CSS is imported
❌ Colors not applied:
- Confirm
shapeDataPath matches data field name
- Verify
shapePropertyPath matches GeoJSON property
- Check
colorValuePath points to correct data field
❌ Markers not showing:
- Inject
Marker service
- Set
visible={true} in MarkerDirective
- Verify latitude/longitude values are valid
❌ Zoom not working:
- Inject
Zoom service
- Set
zoomSettings.enable={true}
- Check if
enablePanning is needed
❌ Legend not appearing:
- Inject
Legend service
- Set
legendSettings.visible={true}
- Ensure color mapping is configured
Next Steps
- Start Simple: Begin with getting-started.md for basic map
- Add Data: Follow data-visualization.md for markers/bubbles
- Style It: Use color-mapping.md for choropleth effects
- Make Interactive: Implement user-interactions.md for zoom/pan
- Enhance: Add advanced features as needed
Choose the reference documentation that matches your current implementation phase and specific requirements.
1---
2name: syncfusion-react-maps
3description: Implement Syncfusion React Maps component for geographical data visualization. Use this when displaying interactive maps, location-based information, or regional data analysis. This skill covers map providers (Bing, OpenStreetMap), GeoJSON rendering, markers and bubbles, zooming/panning, data labels, legends, and choropleth visualizations in React applications.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7 category: "Data Visualization"
8---
9
10# Implementing Syncfusion React Maps
11
12A comprehensive skill for implementing the Syncfusion React Maps component to visualize geographical data with rich interactivity, multiple layers, markers, bubbles, legends, and map provider integration.
13
14## When to Use This Skill
15
16Use this skill when you need to:
17- **Display geographical data** on interactive maps
18- **Visualize location-based information** with markers, bubbles, or data labels
19- **Create choropleth maps** with color-coded regions based on data values
20- **Integrate map providers** like Bing Maps, OpenStreetMap, or Azure Maps
21- **Render custom shapes** from GeoJSON data files
22- **Build multi-layer maps** with overlays and sublayers
23- **Add navigation lines** to show routes or connections between locations
24- **Implement zooming and panning** for map exploration
25- **Display statistical data** on geographical regions
26- **Create interactive legends** for data interpretation
27- **Support multiple projections** (Mercator, Miller, Eckert, etc.)
28- **Handle user interactions** like tooltips, selection, and highlighting
29
30## Component Overview
31
32The Syncfusion React Maps component is a powerful data visualization tool that renders geographical data using Scalable Vector Graphics (SVG). It supports:
33
34- **Any number of layers and sublayers** for complex visualizations
35- **GeoJSON data binding** for custom shape rendering
36- **Map providers** (Bing, OpenStreetMap, Azure) as base layers
37- **6 types of projections** for different map representations
38- **Visual elements**: Markers, Bubbles, Navigation Lines, Annotations, Data Labels, Legends
39- **Interactive features**: Zooming, Panning, Tooltips, Selection, Highlighting
40- **Accessibility**: WCAG 2.1 compliant with keyboard navigation
41- **Globalization**: RTL support, internationalization, localization
42
43## Key Capabilities
44
45### Data Visualization Elements
46- **Markers**: Pin locations with custom shapes, templates, and clustering
47- **Bubbles**: Display data magnitude with size-based bubbles
48- **Data Labels**: Show information directly on map shapes
49- **Color Mapping**: Apply colors based on data values (equal, range, desaturation)
50- **Navigation Lines**: Draw connections between locations with curves and arrows
51- **Legends**: Provide visual keys for data interpretation
52
53### Layer Architecture
54- **Main Layer**: Base map from GeoJSON or map provider
55- **Sublayers**: Overlay additional shapes on top of main layer
56- **Multi-layer Support**: Stack multiple layers for rich visualizations
57
58### Map Providers
59- **Bing Maps**: Satellite, aerial, and road views
60- **OpenStreetMap**: Free tile layer provider
61- **Azure Maps**: Microsoft's map service
62- **Hybrid Approach**: Combine GeoJSON shapes with provider tiles
63
64### User Interactions
65- **Zooming**: Mouse wheel, double-click, pinch, toolbar controls
66- **Panning**: Drag to explore different regions
67- **Tooltips**: Show data on hover
68- **Selection**: Highlight shapes on click
69- **Reset**: Return to initial view
70
71## Documentation and Navigation Guide
72
73### API Reference
74📄 **Read:** [references/api-reference.md](references/api-reference.md)
75- Complete MapsComponent properties reference
76- All available methods with examples
77- Comprehensive events documentation
78- Layer, marker, bubble, and data label settings
79- Legend, zoom, and tooltip configuration
80- Quick reference code examples
81- Type definitions and parameters
82
83### Getting Started
84📄 **Read:** [references/getting-started.md](references/getting-started.md)
85- Installation and package dependencies
86- Basic Maps component implementation
87- GeoJSON data structure and binding
88- CSS theme imports
89- Module injection pattern (feature-based)
90- First world map example
91- Data source binding with shapeDataPath and shapePropertyPath
92
93### Layers and Structure
94📄 **Read:** [references/layers-and-sublayers.md](references/layers-and-sublayers.md)
95- Understanding layer architecture
96- Main layer vs sublayer differences
97- Creating multi-layer maps
98- Layer types and stacking order
99- Layer-specific settings and configuration
100- When to use multiple layers
101
102### Markers
103📄 **Read:** [references/markers.md](references/markers.md)
104- Adding markers to pinpoint locations
105- Marker data source structure (latitude, longitude)
106- Marker shapes and custom templates
107- Marker clustering for dense data
108- Dynamic marker updates
109- Interactive markers with click events
110- Marker tooltips and labels
111
112### Data Visualization Elements
113📄 **Read:** [references/data-visualization.md](references/data-visualization.md)
114- Bubble visualization for data magnitude
115- Configuring bubble size and colors
116- Data label setup and formatting
117- Smart label modes (trim, hide, none)
118- Label templates for custom content
119- Combining bubbles with data labels
120- Best practices for visual hierarchy
121
122### Legend
123📄 **Read:** [references/legend.md](references/legend.md)
124- Enabling and configuring legends
125- Positioning strategies (absolute, dock)
126- Legend alignment options (near, center, far)
127- Interactive legends
128- Legend modes (default, interactive)
129- Customizing legend appearance
130- Syncing legends with color mapping
131
132### Color Mapping
133📄 **Read:** [references/color-mapping.md](references/color-mapping.md)
134- Color mapping types (equal, range, desaturation)
135- Applying colors based on data values
136- Setting up colorValuePath
137- Creating choropleth maps
138- Multiple color mapping rules
139- Custom color schemes
140- Visual data representation strategies
141
142### Navigation Lines
143📄 **Read:** [references/navigation-lines.md](references/navigation-lines.md)
144- Creating lines between locations
145- Line styling (width, color, dash array)
146- Curved lines and angles
147- Arrow indicators for direction
148- Use cases (routes, connections, flows)
149- Animation effects on lines
150
151### Map Providers
152📄 **Read:** [references/map-providers.md](references/map-providers.md)
153- Overview of supported providers
154- When to use GeoJSON vs map providers
155- Bing Maps setup and API keys
156- OpenStreetMap integration (free)
157- Azure Maps configuration
158- Tile layer types (satellite, aerial, road)
159- Hybrid approaches (GeoJSON overlays on provider tiles)
160
161### User Interactions
162📄 **Read:** [references/user-interactions.md](references/user-interactions.md)
163- Enabling and configuring zooming
164- Zoom factor and toolbar controls
165- Panning functionality
166- Tooltip configuration and templates
167- Selection and highlighting shapes
168- Mouse wheel and double-click zoom
169- Pinch zoom for touch devices
170- Reset to initial view
171
172### Annotations and Polygons
173📄 **Read:** [references/annotations-polygon.md](references/annotations-polygon.md)
174- Adding custom annotations to maps
175- Polygon rendering for custom shapes
176- Positioning and alignment
177- Interactive annotations
178- Use cases for overlays
179
180### Customization
181- Map projections (Mercator, Miller, Eckert, Winkel Tripel, Aitoff, Equirectangular)
182- Title and subtitle configuration
183- Border and background styling
184- Margin and padding adjustments
185- Custom CSS classes
186- Theme integration
187- Responsive design patterns
188
189### Advanced Features
190📄 **Read:** [references/advanced-features.md](references/advanced-features.md)
191- Internationalization (i18n)
192- Localization (l10n)
193- Accessibility (WCAG compliance, keyboard navigation)
194- State persistence across sessions
195- Printing and export functionality
196- Event handling patterns
197- Accessing component methods via ref
198- Performance optimization techniques
199- Migration guide from EJ1 to EJ2
200
201## Quick Start Example
202
203```tsx
204import * as React from 'react';
205import { MapsComponent, LayersDirective, LayerDirective, Inject, Legend } from '@syncfusion/ej2-react-maps';
206import { world_map } from './world-map'; // GeoJSON data
207
208function MapExample() {
209 const data = [
210 { Country: 'United States', Population: 331000000, Membership: 'Permanent' },
211 { Country: 'Russia', Population: 145900000, Membership: 'Permanent' },
212 { Country: 'China', Population: 1439000000, Membership: 'Permanent' },
213 { Country: 'India', Population: 1380000000, Membership: 'Non-Permanent' },
214 { Country: 'Brazil', Population: 212500000, Membership: 'Non-Permanent' }
215 ];
216
217 return (
218 <MapsComponent
219 titleSettings={{ text: 'World Map with Country Membership' }}
220 legendSettings={{ visible: true }}
221 >
222 <Inject services={[Legend]} />
223 <LayersDirective>
224 <LayerDirective
225 shapeData={world_map}
226 shapeDataPath='Country'
227 shapePropertyPath='name'
228 dataSource={data}
229 shapeSettings={{
230 colorValuePath: 'Membership',
231 colorMapping: [
232 { value: 'Permanent', color: '#D84444' },
233 { value: 'Non-Permanent', color: '#316DB5' }
234 ]
235 }}
236 />
237 </LayersDirective>
238 </MapsComponent>
239 );
240}
241
242export default MapExample;
243```
244
245## Module Injection Guide
246
247Maps features are modular. Inject only the modules you need:
248
249```tsx
250import {
251 MapsComponent,
252 Inject,
253 Legend, // For legends
254 DataLabel, // For data labels
255 Marker, // For markers
256 Bubble, // For bubbles
257 MapsTooltip, // For tooltips
258 Zoom, // For zooming and panning
259 Highlight, // For highlighting shapes
260 Selection, // For selecting shapes
261 NavigationLine,// For navigation lines
262 Annotations, // For annotations
263 Polygon // For polygons
264} from '@syncfusion/ej2-react-maps';
265
266<MapsComponent>
267 <Inject services={[Legend, Marker, MapsTooltip, Zoom]} />
268 {/* Your layers */}
269</MapsComponent>
270```
271
272**Only inject modules for features you're using** to minimize bundle size.
273
274## Common Use Cases
275
276### Choropleth Map (Color-Coded Regions)
277**Goal**: Display statistical data with color-coded countries/regions
278
279**Approach**:
2801. Bind data source with `dataSource`, `shapeDataPath`, `shapePropertyPath`
2812. Configure `shapeSettings.colorValuePath` to specify data field
2823. Set up `colorMapping` with value-color pairs
2834. Add `Legend` for interpretation
284
285**Example**: Population density map, election results, COVID-19 statistics
286
287---
288
289### Location Markers Map
290**Goal**: Show specific locations with custom markers
291
292**Approach**:
2931. Add `MarkersDirective` inside `LayerDirective`
2942. Provide marker data with latitude/longitude
2953. Customize marker shapes, sizes, and templates
2964. Add tooltips for marker information
297
298**Example**: Store locator, branch offices, tourist attractions
299
300---
301
302### Multi-Layer Overlay
303**Goal**: Highlight specific regions on a base map
304
305**Approach**:
3061. First layer: Base map (e.g., entire country)
3072. Additional layers with `type="SubLayer"`: Highlighted regions
3083. Style sublayers distinctly (different colors, borders)
3094. Control layer visibility and order
310
311**Example**: State highlights on country map, sales regions
312
313---
314
315### Route Visualization
316**Goal**: Show connections or routes between locations
317
318**Approach**:
3191. Add markers for start/end points
3202. Use `NavigationLineDirective` to draw lines
3213. Configure line curves, arrows, and styling
3224. Optionally animate lines
323
324**Example**: Flight routes, shipping lanes, migration patterns
325
326---
327
328### Map Provider Integration
329**Goal**: Use real-world satellite/street map as base
330
331**Approach**:
3321. Configure layer with `urlTemplate` for provider
3332. Set up API keys (Bing, Azure) if required
3343. Overlay GeoJSON shapes as sublayers if needed
3354. Add markers and labels on top
336
337**Example**: Real estate map, delivery tracking, ride-sharing app
338
339## Decision Trees
340
341### Should I Use GeoJSON or Map Provider?
342
343**Use GeoJSON when**:
344- You need custom shapes or boundaries
345- Data is region/country-based (choropleth maps)
346- No real-world street-level detail needed
347- Offline capability required
348- Full control over styling and data binding
349
350**Use Map Provider when**:
351- Need real-world satellite/aerial imagery
352- Street-level detail required
353- Real-time map updates desired
354- Users expect familiar map interface (like Google Maps)
355
356**Use Both (Hybrid) when**:
357- Need real-world base with custom shape overlays
358- Combining statistical regions with street context
359
360---
361
362### Which Color Mapping Type?
363
364**Equal Color Mapping**:
365- Use when data has discrete categories (e.g., Membership: Permanent/Non-Permanent)
366- Each unique value gets a specific color
367
368**Range Color Mapping**:
369- Use when data is numeric and continuous (e.g., Population: 0-1M, 1M-10M, 10M+)
370- Values within ranges get assigned colors
371
372**Desaturation Color Mapping**:
373- Use for gradient effects based on numeric values
374- Single color with varying saturation levels
375
376---
377
378### How Many Layers Should I Use?
379
380**Single Layer**:
381- Simple visualizations with one data dimension
382- Basic country/region maps
383- When all data fits one layer
384
385**Multiple Layers**:
386- Highlighting specific regions on base map
387- Combining different data sources
388- Creating visual depth with overlays
389- Showing borders, rivers, cities separately
390
391## Key Props Reference
392
393### MapsComponent
394- `titleSettings`: Configure title and subtitle
395- `legendSettings`: Legend visibility, position, alignment
396- `zoomSettings`: Enable zooming, set initial zoom factor
397- `layers`: Array of layer configurations
398
399### LayerDirective
400- `shapeData`: GeoJSON data for shapes
401- `dataSource`: Data to bind to shapes
402- `shapeDataPath`: Field in dataSource matching shapes
403- `shapePropertyPath`: Field in GeoJSON matching dataSource
404- `shapeSettings`: Fill, border, color mapping
405- `type`: "Layer" (main) or "SubLayer" (overlay)
406- `markerSettings`: Marker configurations
407- `bubbleSettings`: Bubble visualizations
408- `dataLabelSettings`: Label configurations
409- `tooltipSettings`: Tooltip customization
410- `navigationLineSettings`: Line visualizations
411
412### Common Patterns
413- **Module Injection**: Only inject needed services to reduce bundle size
414- **Data Binding**: Use shapeDataPath + shapePropertyPath for automatic matching
415- **Progressive Enhancement**: Start with basic map, add features incrementally
416- **Responsive Design**: Maps auto-resize, but test on different viewports
417
418## Troubleshooting Quick Checks
419
420❌ **Map not displaying**:
421- Verify GeoJSON data is correctly imported
422- Check console for errors
423- Ensure CSS is imported
424
425❌ **Colors not applied**:
426- Confirm `shapeDataPath` matches data field name
427- Verify `shapePropertyPath` matches GeoJSON property
428- Check `colorValuePath` points to correct data field
429
430❌ **Markers not showing**:
431- Inject `Marker` service
432- Set `visible={true}` in MarkerDirective
433- Verify latitude/longitude values are valid
434
435❌ **Zoom not working**:
436- Inject `Zoom` service
437- Set `zoomSettings.enable={true}`
438- Check if `enablePanning` is needed
439
440❌ **Legend not appearing**:
441- Inject `Legend` service
442- Set `legendSettings.visible={true}`
443- Ensure color mapping is configured
444
445
446## Next Steps
447
4481. **Start Simple**: Begin with getting-started.md for basic map
4492. **Add Data**: Follow data-visualization.md for markers/bubbles
4503. **Style It**: Use color-mapping.md for choropleth effects
4514. **Make Interactive**: Implement user-interactions.md for zoom/pan
4525. **Enhance**: Add advanced features as needed
453
454Choose the reference documentation that matches your current implementation phase and specific requirements.