
Syncfusion Angular Maps
- 200 installs
- Updated August 4, 2026
- syncfusion/angular-ui-components-skills
Use syncfusion-angular-maps for development tasks
About
syncfusion-angular-maps: A skill for development. This provides functionality for development workflows.
- syncfusion-angular-maps
Syncfusion Angular Maps by the numbers
- 200 all-time installs (skills.sh)
- +5 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #1,977 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/syncfusion/angular-ui-components-skills --skill syncfusion-angular-mapsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 200 |
|---|---|
| Last updated | August 4, 2026 |
| Repository | syncfusion/angular-ui-components-skills ↗ |
What it does
Use syncfusion-angular-maps for development tasks
Files
Implementing Syncfusion Angular Maps
Comprehensive guide for implementing the Syncfusion Angular Maps component to visualize geographical data with interactive features, multiple layers, and rich customization options.
When to Use This Skill
Use this skill when you need to:
- Visualize geographical data - Display statistical data on world maps, country maps, regional maps, or custom geographic shapes
- Create interactive maps - Build maps with zoom, pan, selection, highlighting, and tooltip interactions
- Plot locations - Add markers, bubbles, or annotations to highlight specific geographic points
- Display map layers - Work with multiple overlapping layers using GeoJSON data or map providers (Bing, OpenStreetMap, Azure)
- Color-code regions - Apply color mapping based on data values for choropleth/heat map visualizations
- Custom map visualizations - Create non-geographic visualizations like seat layouts, floor plans, or stadium maps
- Navigation and routing - Draw navigation lines or routes between markers
- Export and print maps - Generate printable or exportable map visualizations
- Build dashboards - Integrate maps into Angular applications for business intelligence or analytics
Component Overview
The Syncfusion Angular Maps component (@syncfusion/ej2-angular-maps) is a powerful data visualization tool that renders geographical data using Scalable Vector Graphics (SVG). It supports:
- Multiple layers and sublayers for complex visualizations
- GeoJSON data binding for custom shapes and regions
- Map providers (Bing Maps, OpenStreetMap, Azure Maps) as base layers
- Six projection types (Mercator, Equirectangular, Miller, Eckert3, Eckert5, Eckert6, Winkel3, AitOff)
- Rich visualization elements - markers, bubbles, data labels, legends, navigation lines, annotations
- Interactive features - zooming, panning, tooltips, selection, highlighting
- Responsive and accessible design with WCAG compliance
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
When implementing Maps for the first time or setting up a new Angular project:
- Installing dependencies (@syncfusion/ej2-angular-maps package)
- Setting up Angular environment and importing MapsModule
- Creating first basic map with world map data
- Understanding module injection for features (MarkerService, BubbleService, etc.)
- Adding CSS themes and styling
- Running the application
Layers and Data Binding
📄 Read: references/layers-and-data.md
For working with map layers, shape data, and data source binding:
- Understanding layer structure and configuration
- Loading GeoJSON shape data (shapeData property)
- Binding external data sources (dataSource, shapeDataPath, shapePropertyPath)
- Creating multiple layers and sublayers
- Layer types (base layer vs sublayer)
- Switching between layers (baseLayerIndex)
- Rendering custom shapes for non-geographic visualizations
- GeometryType options (Geographic vs Normal)
Markers
📄 Read: references/markers.md
For adding and customizing location markers:
- Adding markers with latitude/longitude data
- Marker shapes (Balloon, Circle, Cross, Diamond, Image, Rectangle, Star, Triangle)
- Custom marker templates
- Marker styling (size, color, border, opacity)
- Dynamic markers with data binding
- Marker clustering
- Marker animations and transitions
- Marker tooltips and events
- Creating routes between markers
Data Visualization Features
📄 Read: references/data-visualization.md
For visualizing data with bubbles, colors, labels, and legends:
- Bubbles - Size-based visualization for quantitative data
- Color mapping - Range color mapping, equal color mapping, desaturation color mapping
- Data labels - Displaying shape names or data values on the map
- Legends - Adding legends for color mapping and bubbles
- Navigation lines - Drawing lines between locations
- Annotations - Adding custom HTML content at specific positions
- Combining multiple visualization features
User Interactions
📄 Read: references/user-interactions.md
For implementing interactive map behaviors:
- Zooming - Mouse wheel zoom, pinch zoom, double-click zoom, zoom toolbar
- Panning - Mouse drag and touch panning
- Tooltips - Layer tooltips, marker tooltips, bubble tooltips
- Selection - Shape selection, marker selection, bubble selection
- Highlighting - Hover highlight effects
- Interactive legend - Clicking legend items to show/hide shapes
- Event handling (click, hover, zoom, pan events)
- Touch and mobile support
Map Providers
📄 Read: references/map-providers.md
For integrating external map services:
- Overview of map provider support
- Bing Maps integration and API key configuration
- OpenStreetMap (OSM) integration
- Azure Maps integration
- Provider-specific features and limitations
- Combining map providers with shape layers
- URL templates and tile services
- Zoom level configuration
Polygon Shapes
📄 Read: references/polygon-shapes.md
For drawing and customizing polygons:
- Adding polygon overlays to maps
- Polygon configuration and data structure
- Styling polygons (fill, border, opacity)
- Polygon events (click, hover)
- Use cases (highlighting regions, boundaries, zones)
- Dynamic polygon rendering
Customization and Styling
📄 Read: references/customization.md
For theming and visual customization:
- CSS customization and theme overrides
- Shape styling (fill, border, color schemes)
- Responsive design patterns
- Map projections - Choosing and configuring projection types
- Background customization (colors, images)
- Title and subtitle styling
- Border and margin configuration
Localization and Internationalization
📄 Read: references/localization.md
For globalizing map content:
- Internationalization (i18n) setup
- Localization (l10n) for different languages
- Right-to-left (RTL) support
- Number formatting for different locales
- Currency formatting in tooltips/labels
- Date and time formatting
- Culture-specific rendering
Advanced Features
📄 Read: references/advanced-features.md
For advanced capabilities and APIs:
- Print and Export - Printing maps, exporting to PNG/JPEG/SVG/PDF
- State persistence - Saving and restoring map state
- Public methods - Programmatic control (refresh, print, export, etc.)
- Events reference - Complete list of available events
- Creating routes - Drawing navigation routes between markers
- Custom path rendering - Advanced path and line customization
- Drilldown navigation - Creating hierarchical map navigation
Accessibility
📄 Read: references/accessibility.md
For accessible map implementations:
- WCAG 2.1 compliance guidelines
- Keyboard navigation support
- ARIA attributes and roles
- Screen reader compatibility
- High contrast theme support
- Focus indicators and management
- Alternative text for shapes and markers
Quick Start
Installation
# Install the Maps package
npm install @syncfusion/ej2-angular-maps --saveBasic Implementation
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map'; // GeoJSON data
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = world_map;
}With Data Binding and Color Mapping
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<e-layer
[shapeData]='shapeData'
[dataSource]='dataSource'
shapeDataPath='Country'
shapePropertyPath='name'
[shapeSettings]='shapeSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = world_map;
public dataSource: object[] = [
{ Country: 'United States', Population: 331002651, Code: 'US' },
{ Country: 'India', Population: 1380004385, Code: 'IN' },
{ Country: 'China', Population: 1439323776, Code: 'CN' }
];
public shapeSettings: object = {
colorValuePath: 'Population',
colorMapping: [
{ from: 0, to: 100000000, color: '#C5E8B7' },
{ from: 100000001, to: 500000000, color: '#5BC85A' },
{ from: 500000001, to: 2000000000, color: '#238B45' }
]
};
}Common Patterns
Pattern 1: Map with Markers and Tooltips
import { Component } from '@angular/core';
import { MapsModule, MarkerService, MapsTooltipService } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [MarkerService, MapsTooltipService],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<e-layer
[shapeData]='shapeData'
[markerSettings]='markerSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = world_map;
public markerSettings: object[] = [{
visible: true,
dataSource: [
{ latitude: 40.7128, longitude: -74.0060, name: 'New York' },
{ latitude: 51.5074, longitude: -0.1278, name: 'London' },
{ latitude: 35.6762, longitude: 139.6503, name: 'Tokyo' }
],
shape: 'Circle',
fill: '#FF6347',
height: 15,
width: 15,
tooltipSettings: {
visible: true,
valuePath: 'name'
}
}];
}Pattern 2: Interactive Map with Zoom and Legend
import { Component } from '@angular/core';
import { MapsModule, ZoomService, LegendService } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [ZoomService, LegendService],
template: `
<ejs-maps
id='maps-container'
[zoomSettings]='zoomSettings'
[legendSettings]='legendSettings'>
<e-layers>
<e-layer
[shapeData]='shapeData'
[dataSource]='dataSource'
shapeDataPath='Country'
shapePropertyPath='name'
[shapeSettings]='shapeSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = world_map;
public dataSource: object[] = [
{ Country: 'United States', Category: 'High' },
{ Country: 'Canada', Category: 'Medium' },
{ Country: 'Mexico', Category: 'Low' }
];
public shapeSettings: object = {
colorValuePath: 'Category',
colorMapping: [
{ value: 'High', color: '#E74C3C' },
{ value: 'Medium', color: '#F39C12' },
{ value: 'Low', color: '#27AE60' }
]
};
public zoomSettings: object = {
enable: true,
toolbars: ['Zoom', 'ZoomIn', 'ZoomOut', 'Pan', 'Reset']
};
public legendSettings: object = {
visible: true,
position: 'Bottom'
};
}Pattern 3: Multi-Layer Map with Sublayers
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
import { usa_map } from './usa-map';
import { california } from './california';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<!-- Base layer -->
<e-layer
[shapeData]='usaMap'
[shapeSettings]='baseShapeSettings'>
</e-layer>
<!-- Sublayer highlighting California -->
<e-layer
type='SubLayer'
[shapeData]='californiaMap'
[shapeSettings]='sublayerShapeSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public usaMap: object = usa_map;
public californiaMap: object = california;
public baseShapeSettings: object = {
fill: '#E5E5E5',
border: { color: '#000000', width: 0.5 }
};
public sublayerShapeSettings: object = {
fill: '#FFD700',
border: { color: '#FF6347', width: 2 }
};
}Key Configuration Options
Layer Settings
shapeData- GeoJSON data for shapesdataSource- External data to bindshapeDataPath- Field in dataSource identifying shapeshapePropertyPath- Field in shapeData matching dataSourceshapeSettings- Visual styling for shapestype- Layer type ('Layer' or 'SubLayer')
Shape Settings
fill- Shape fill colorborder- Border configuration (color, width, opacity)colorValuePath- Data field for color mappingcolorMapping- Array of color ranges or valuesautofill- Auto-generate colors for shapes
Marker Settings
visible- Show/hide markersdataSource- Marker data with latitude/longitudeshape- Marker shape typeheight/width- Marker dimensionstemplate- Custom HTML templatetooltipSettings- Marker tooltip configuration
Zoom Settings
enable- Enable/disable zoomingzoomFactor- Initial zoom levelmaxZoom/minZoom- Zoom limitstoolbars- Zoom control buttonsmouseWheelZoom- Enable mouse wheel zoomingpinchZooming- Enable touch pinch zoom
Legend Settings
visible- Show/hide legendposition- Legend placement (Top, Bottom, Left, Right)mode- Legend mode ('Default', 'Interactive')type- Legend type ('Layers', 'Bubbles', 'Markers')
Common Use Cases
Use Case 1: Sales Dashboard by Region
Create choropleth maps showing sales data across countries or states with color-coded regions, interactive tooltips, and legends. Useful for business intelligence dashboards.
Use Case 2: Store Locator Map
Display store locations with custom marker icons, clustering for dense areas, and tooltips showing store details. Integrate with map providers for street-level detail.
Use Case 3: Election Results Visualization
Show election results across districts/states using color mapping, with drilldown capability to explore detailed regional data.
Use Case 4: Real-time Tracking Dashboard
Plot vehicle, shipment, or asset locations with animated markers, navigation lines showing routes, and real-time data updates.
Use Case 5: Weather or Environmental Data
Visualize temperature, rainfall, air quality, or other environmental metrics using color gradients and data labels on geographic regions.
Use Case 6: COVID-19 or Disease Spread Tracking
Display case counts, vaccination rates, or infection rates by region using bubble sizes and color intensity.
Use Case 7: Flight Route Visualization
Show flight paths between cities using navigation lines, with markers for airports and interactive selection.
Use Case 8: Custom Seating Layouts
Use custom GeoJSON shapes for non-geographic visualizations like seat selection in theaters, stadiums, or transportation.
Module Injection Requirements
The Maps component uses feature-specific services that must be injected:
import {
MapsModule,
MarkerService, // For markers
BubbleService, // For bubbles
DataLabelService, // For data labels
LegendService, // For legends
MapsTooltipService, // For tooltips
ZoomService, // For zoom and pan
SelectionService, // For selection
HighlightService, // For highlighting
NavigationLineService, // For navigation lines
AnnotationsService, // For annotations
PolygonService // For polygons
} from '@syncfusion/ej2-angular-maps';
@Component({
providers: [
MarkerService,
LegendService,
MapsTooltipService,
ZoomService
// Add only the services you need
]
})API Reference Documentation
Complete API Catalog
📘 [Full API Reference Guide](./references/api-reference.md) - Comprehensive documentation of all Maps APIs
Quick API Links by Category
Core Component
- MapsComponent - Main maps component with 20+ properties and methods
- print() - Print functionality
- export() - Export to Image/PDF
- refresh() - Refresh map
- addLayer() - Add layer dynamically
Layer Configuration
- LayerSettings - Layer configuration model
- ShapeSettings - Shape styling configuration
- shapeData - GeoJSON shape data
- dataSource - External data binding
Markers & Bubbles
- MarkerSettings - Marker configuration
- BubbleSettings - Bubble visualization
- DataLabelSettings - Data labels
User Interactions
- ZoomSettings - Zoom and pan configuration
- TooltipSettings - Tooltip configuration
- SelectionSettings - Selection behavior
- HighlightSettings - Highlight behavior
Customization
- LegendSettings - Legend configuration
- ColorMappingSettings - Color mapping for choropleth
- NavigationLineSettings - Navigation lines
- Annotation - Custom annotations
Key Events (25+ Total)
- load - Before map loads
- loaded - After map loads
- shapeSelected - Shape selection event
- markerClick - Marker click event
- zoom - Zoom event
- pan - Pan event
Enumerations
- ProjectionType - Map projection types (Mercator, Miller, Eckert, etc.)
- MarkerType - Marker shapes (Balloon, Circle, Diamond, etc.)
- LayerType - Layer vs SubLayer
- GeometryType - Geographic vs Normal
Event Interfaces
- ILoadEventArgs - Load event arguments
- IShapeSelectedEventArgs - Selection event args
- IMarkerClickEventArgs - Marker click args
Context-Specific API References
Each reference guide includes relevant API tables:
- [getting-started.md](./references/getting-started.md) - Core setup APIs
- [layers-and-data.md](./references/layers-and-data.md) - Layer and data binding APIs
- [markers.md](./references/markers.md) - Marker APIs and events
- [data-visualization.md](./references/data-visualization.md) - Bubble, color mapping, legend APIs
- [user-interactions.md](./references/user-interactions.md) - Zoom, pan, tooltip, selection APIs
- [map-providers.md](./references/map-providers.md) - Map provider APIs
- [customization.md](./references/customization.md) - Appearance and styling APIs
- [accessibility.md](./references/accessibility.md) - Accessibility-related APIs
---
Next Steps
1. Start with getting-started.md to set up your first map 2. Explore layers-and-data.md to understand data binding 3. Add markers.md to plot locations 4. Implement user-interactions.md for zoom, pan, and tooltips 5. Review customization.md for styling and themes 6. Check accessibility.md to ensure WCAG compliance
---
Package: @syncfusion/ej2-angular-maps Documentation: Syncfusion Angular Maps Documentation Demos: Syncfusion Angular Maps Demos
Accessibility in Syncfusion Angular Maps
Table of Contents
- Overview
- WCAG Compliance
- Screen Reader Support
- Keyboard Navigation
- ARIA Attributes
- Color Contrast
- Testing Accessibility
- Best Practices
- Common Issues
- Next Steps
Overview
The Syncfusion Angular Maps component is designed to be fully accessible to users with disabilities through assistive technologies such as screen readers and keyboard navigation. It complies with:
- WCAG 2.2 (Web Content Accessibility Guidelines)
- Section 508 (U.S. Federal accessibility standards)
- ADA (Americans with Disabilities Act)
- WAI-ARIA patterns for accessible web applications
Key accessibility features include keyboard navigation for all interactive elements, ARIA attributes for screen reader compatibility, high contrast theme support, and mobile device accessibility.
WCAG Compliance
The Maps component meets WCAG 2.2 Level AA requirements:
| Accessibility Criteria | Support Level |
|---|---|
| WCAG 2.2 Support | ✓ Full Support |
| Section 508 Support | ✓ Full Support |
| Screen Reader Support | ✓ Full Support |
| Keyboard Navigation | ✓ Full Support |
| Color Contrast | ✓ Full Support |
| Mobile Device Support | ✓ Full Support |
Basic accessible map implementation:
import { Component, OnInit } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-accessible-map',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps
id="accessible-maps"
[titleSettings]="titleSettings"
[layers]="layers">
</ejs-maps>
`
})
export class AccessibleMapComponent implements OnInit {
public layers: object[] = [];
public titleSettings: object = {
text: 'World Population Density',
textStyle: { size: '16px' }
};
ngOnInit(): void {
this.layers = [{
shapeData: worldMap,
shapeSettings: {
colorValuePath: 'density',
fill: '#E5E5E5'
}
}];
}
}Screen Reader Support
The Maps component provides screen reader support for all key elements. Screen readers will announce the following content:
| Element | What Gets Read |
|---|---|
| Shapes (countries/regions) | Geographic shape names |
| Title | Main title content |
| Subtitle | Secondary title content |
| Legend title | Legend heading |
| Legend items | Individual legend labels |
| Data labels | Shape-specific labels |
| Markers | Marker template content |
| Annotations | Annotation content |
| Tooltips | Tooltip template content |
Configuring accessible labels for shapes:
import { Component } from '@angular/core';
@Component({
selector: 'app-screen-reader-map',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps [layers]="layers"></ejs-maps>
`
})
export class ScreenReaderMapComponent {
public layers: object[] = [{
shapeData: worldMap,
dataSource: [
{ country: 'United States', population: '331 million',
accessibility: 'United States has a population of 331 million' },
{ country: 'China', population: '1.4 billion',
accessibility: 'China has a population of 1.4 billion' },
{ country: 'India', population: '1.38 billion',
accessibility: 'India has a population of 1.38 billion' }
],
shapePropertyPath: 'name',
shapeDataPath: 'country',
shapeSettings: {
colorValuePath: 'population',
// aria-label will use the accessibility property
autofill: true
}
}];
}Accessible marker templates:
import { Component } from '@angular/core';
@Component({
selector: 'app-accessible-markers',
providers: [MarkerService],
template: `
<ejs-maps [layers]="layers">
<e-layers>
<e-layer [markerSettings]="markerSettings"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AccessibleMarkersComponent {
public markerSettings: object[] = [{
visible: true,
dataSource: [
{ latitude: 40.7128, longitude: -74.0060, city: 'New York' },
{ latitude: 51.5074, longitude: -0.1278, city: 'London' }
],
// Screen readers will announce this template content
template: '<div aria-label="City marker: {{:city}}">📍 {{:city}}</div>'
}];
}Keyboard Navigation
All interactive map features are accessible via keyboard, ensuring users who cannot use a mouse can fully navigate and interact with the component.
Supported Keyboard Shortcuts
| Key Combination | Action |
|---|---|
Tab | Move to next focusable element (legend, shape) |
Shift + Tab | Move to previous focusable element |
+ (Plus) | Zoom in (when zooming enabled) |
- (Minus) | Zoom out (when zooming enabled) |
R | Reset zoom to initial state |
Arrow Left | Pan map left (when zoomed) |
Arrow Right | Pan map right (when zoomed) |
Arrow Up | Pan map up (when zoomed) |
Arrow Down | Pan map down (when zoomed) |
Enter | Navigate legend pages or select shape |
Enabling keyboard navigation with zoom:
import { Component } from '@angular/core';
import { ZoomService } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-keyboard-map',
providers: [ZoomService],
template: `
<ejs-maps
[zoomSettings]="zoomSettings"
[layers]="layers">
</ejs-maps>
`
})
export class KeyboardMapComponent {
public zoomSettings: object = {
enable: true,
enableSelectionZooming: false,
toolbars: ['Zoom', 'ZoomIn', 'ZoomOut', 'Pan', 'Reset']
};
public layers: object[] = [{
shapeData: worldMap,
shapeSettings: {
fill: '#E5E5E5'
}
}];
}Handling custom keyboard events:
import { Component, ViewChild } from '@angular/core';
import { MapsComponent } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-custom-keyboard',
template: `
<div (keydown)="onKeyDown($event)" tabindex="0">
<ejs-maps #maps [layers]="layers"></ejs-maps>
</div>
`
})
export class CustomKeyboardComponent {
@ViewChild('maps') public maps!: MapsComponent;
public layers: object[] = [{ shapeData: worldMap }];
public onKeyDown(event: KeyboardEvent): void {
switch(event.key) {
case 'h':
case 'H':
// Custom: Go to home/default view
this.maps.zoomSettings.zoomFactor = 1;
this.maps.refresh();
break;
case 'f':
case 'F':
// Custom: Toggle fullscreen
this.toggleFullscreen();
break;
}
}
private toggleFullscreen(): void {
const element = document.getElementById('maps')!;
if (!document.fullscreenElement) {
element.requestFullscreen();
} else {
document.exitFullscreen();
}
}
}ARIA Attributes
The Maps component uses WAI-ARIA attributes to enhance screen reader compatibility and provide semantic information about interactive elements.
ARIA Roles Used
| ARIA Role | Applied To | Purpose |
|---|---|---|
role="region" | Non-interactive shapes | Indicates informational map area |
role="button" | Interactive shapes | Indicates selectable/highlightable shapes |
aria-label | All elements | Provides accessible name for element |
Configuring ARIA labels for legend:
import { Component } from '@angular/core';
import { LegendService } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-aria-legend',
providers: [LegendService],
template: `
<ejs-maps [legendSettings]="legendSettings" [layers]="layers"></ejs-maps>
`
})
export class AriaLegendComponent {
public legendSettings: object = {
visible: true,
title: {
text: 'Population Density Legend',
// Screen readers will announce this
textStyle: { size: '14px' }
}
};
public layers: object[] = [{
shapeData: worldMap,
dataSource: populationData,
shapeSettings: {
colorMapping: [
{ from: 0, to: 100, color: '#90EE90', label: 'Low density (0-100)' },
{ from: 100, to: 500, color: '#FFA500', label: 'Medium density (100-500)' },
{ from: 500, to: 1000, color: '#FF4500', label: 'High density (500+)' }
]
}
}];
}Custom ARIA attributes for tooltips:
import { Component } from '@angular/core';
import { MapsTooltipService } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-aria-tooltip',
providers: [MapsTooltipService],
template: `
<ejs-maps [layers]="layers"></ejs-maps>
`
})
export class AriaTooltipComponent {
public layers: object[] = [{
shapeData: worldMap,
tooltipSettings: {
visible: true,
valuePath: 'name',
// Template with ARIA attributes
template: '<div role="tooltip" aria-live="polite">' +
'<strong>${name}</strong><br/>' +
'Population: ${population}' +
'</div>'
}
}];
}Color Contrast
The Maps component supports high contrast themes to meet WCAG AA standards (minimum contrast ratio of 4.5:1 for normal text).
Using high contrast theme:
import { Component } from '@angular/core';
@Component({
selector: 'app-high-contrast-map',
template: `
<ejs-maps [layers]="layers" cssClass="e-highcontrast"></ejs-maps>
`,
styles: [`
/* Apply high contrast theme */
::ng-deep .e-highcontrast .e-maps-shape {
stroke: #FFFFFF;
stroke-width: 2px;
}
`]
})
export class HighContrastMapComponent {
public layers: object[] = [{
shapeData: worldMap,
shapeSettings: {
fill: '#000000',
border: { color: '#FFFFFF', width: 2 }
}
}];
}Ensuring sufficient color contrast:
import { Component } from '@angular/core';
@Component({
selector: 'app-contrast-map',
template: `<ejs-maps [layers]="layers"></ejs-maps>`
})
export class ContrastMapComponent {
public layers: object[] = [{
shapeData: worldMap,
shapeSettings: {
colorMapping: [
// WCAG AA compliant colors
{ from: 0, to: 50, color: '#004085' }, // Dark blue
{ from: 50, to: 100, color: '#0056b3' }, // Medium blue
{ from: 100, to: 150, color: '#CC5500' }, // Orange
{ from: 150, to: 200, color: '#8B0000' } // Dark red
]
}
}];
}Testing Accessibility
Validate your Maps implementation using automated accessibility testing tools.
Using accessibility-checker
# Install accessibility testing tools
npm install --save-dev accessibility-checker axe-coreJest test with accessibility validation:
import { TestBed } from '@angular/core/testing';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { AccessibleMapComponent } from './accessible-map.component';
import { axe, toHaveNoViolations } from 'jest-axe';
expect.extend(toHaveNoViolations);
describe('Accessible Maps Component', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [MapsModule, AccessibleMapComponent]
});
});
it('should have no accessibility violations', async () => {
const fixture = TestBed.createComponent(AccessibleMapComponent);
fixture.detectChanges();
const results = await axe(fixture.nativeElement);
expect(results).toHaveNoViolations();
});
it('should have proper ARIA labels', () => {
const fixture = TestBed.createComponent(AccessibleMapComponent);
fixture.detectChanges();
const mapElement = fixture.nativeElement.querySelector('.e-maps');
expect(mapElement.getAttribute('role')).toBeTruthy();
});
});Manual accessibility testing checklist:
- ✓ Navigate entire map using only keyboard
- ✓ Verify screen reader announces all elements
- ✓ Test with high contrast mode enabled
- ✓ Validate color contrast ratios (use browser dev tools)
- ✓ Test on mobile devices with accessibility features
- ✓ Verify focus indicators are visible
- ✓ Test with browser zoom at 200%
Best Practices
1. Always provide meaningful titles and labels:
- Set descriptive title text for the map
- Add legend titles explaining color coding
- Use clear data label text
2. Ensure interactive elements are keyboard accessible:
- Enable zoom and pan controls
- Make shapes selectable if interactive
- Provide keyboard shortcuts for common actions
3. Use sufficient color contrast:
- Choose colors meeting WCAG AA standards (4.5:1 minimum)
- Don't rely solely on color to convey information
- Provide alternative text labels
4. Test with assistive technologies:
- Use screen readers (NVDA, JAWS, Narrator)
- Test keyboard navigation thoroughly
- Validate with automated tools (axe, WAVE)
5. Provide alternative text for visual information:
- Add ARIA labels to markers and tooltips
- Include descriptive text in legends
- Consider providing data table alternatives for complex visualizations
Common Issues
Issue: Screen reader not announcing map elements
Solution: Ensure the Maps module is properly imported and aria-label attributes are configured:
public layers: object[] = [{
shapeData: worldMap,
shapeSettings: {
autofill: true,
colorValuePath: 'value'
},
// Add data with descriptive properties for screen readers
dataSource: countryData
}];Issue: Keyboard navigation not working
Solution: Ensure the map container is focusable and zoom is enabled:
<div tabindex="0">
<ejs-maps [zoomSettings]="{ enable: true }" [layers]="layers"></ejs-maps>
</div>Issue: Low color contrast in custom themes
Solution: Use a color contrast checker and adjust colors:
// Use WCAG AA compliant colors
shapeSettings: {
colorMapping: [
{ from: 0, to: 100, color: '#003366' }, // 7:1 contrast ratio
{ from: 100, to: 200, color: '#8B4513' } // 5.5:1 contrast ratio
]
}Next Steps
- [User Interactions](./user-interactions.md) - Learn about zoom, pan, and selection features
- [Customization](./customization.md) - Explore theme customization including high contrast themes
- [Data Visualization](./data-visualization.md) - Add accessible legends, labels, and tooltips
- [Getting Started](./getting-started.md) - Return to basic setup instructions
---
API Reference Summary
Accessibility APIs
| API | Description | Documentation Link |
|---|---|---|
enablePersistence | Persist component state | enablePersistence |
enableRtl | Right-to-left rendering | enableRtl |
locale | Localization culture | locale |
For complete API documentation, see: api-reference.md
Advanced Features
Complete guide to advanced Maps capabilities including print, export, state persistence, public methods, events, routes, and drilldown navigation.
Table of Contents
- Print and Export
- State Persistence
- Public Methods
- Events
- Creating Routes Between Markers
- Custom Path Rendering
- Drilldown Navigation
- Best Practices
Print and Export
Printing Maps
Enable direct printing from the browser:
import { Component } from '@angular/core';
import { MapsModule, PrintService, Maps } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [PrintService],
template: `
<button (click)='printMap()'>Print Map</button>
<ejs-maps
#maps
id='maps-container'
[allowPrint]='true'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
@ViewChild('maps') maps: Maps;
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
printMap() {
this.maps.print();
}
}Exporting to Image
Export maps as PNG, JPEG, or SVG:
import { Component } from '@angular/core';
import { MapsModule, ImageExportService, Maps } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [ImageExportService],
template: `
<div>
<button (click)='exportPNG()'>Export as PNG</button>
<button (click)='exportJPEG()'>Export as JPEG</button>
<button (click)='exportSVG()'>Export as SVG</button>
</div>
<ejs-maps
#maps
id='maps-container'
[allowImageExport]='true'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
@ViewChild('maps') maps: Maps;
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
exportPNG() {
this.maps.export('PNG', 'map-export');
}
exportJPEG() {
this.maps.export('JPEG', 'map-export');
}
exportSVG() {
this.maps.export('SVG', 'map-export');
}
}Exporting to PDF
import { Component } from '@angular/core';
import { MapsModule, PdfExportService, Maps } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [PdfExportService],
template: `
<button (click)='exportPDF()'>Export as PDF</button>
<ejs-maps
#maps
id='maps-container'
[allowPdfExport]='true'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
@ViewChild('maps') maps: Maps;
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
exportPDF() {
this.maps.export('PDF', 'map-export', 'Portrait'); // or 'Landscape'
}
}Export as Base64 String
exportAsBase64() {
// Returns base64 string instead of downloading
this.maps.export('PNG', 'map', null, false).then((dataUrl: string) => {
console.log('Base64 string:', dataUrl);
// Use dataUrl for uploading, displaying, etc.
});
}State Persistence
Save and restore map state across page reloads:
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps
id='maps-container'
[enablePersistence]='true'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
}What gets persisted:
- Zoom level and position
- Selected shapes/markers
- Pan position
- Layer visibility
Storage location: Browser's localStorage
Clear persisted state:
localStorage.removeItem('maps-container');Public Methods
getMinMaxLatitudeLongitude
Get the current visible geographic bounds:
import { Component, ViewChild } from '@angular/core';
import { MapsModule, Maps } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<button (click)='getBounds()'>Get Bounds</button>
<ejs-maps #maps id='maps-container'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
@ViewChild('maps') maps: Maps;
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
getBounds() {
const bounds = this.maps.getMinMaxLatitudeLongitude();
console.log('Bounds:', bounds);
// {
// minLatitude: -55.0,
// maxLatitude: 75.0,
// minLongitude: -180.0,
// maxLongitude: 180.0
// }
}
}refresh
Manually refresh the map:
refreshMap() {
this.maps.refresh();
}addMarker
Dynamically add markers:
addMarkerDynamically() {
const newMarker = {
latitude: 35.6762,
longitude: 139.6503,
name: 'Tokyo'
};
this.maps.layers[0].markerSettings[0].dataSource.push(newMarker);
this.maps.refresh();
}removeMarker
Remove specific markers:
removeMarker(index: number) {
this.maps.layers[0].markerSettings[0].dataSource.splice(index, 1);
this.maps.refresh();
}Events
The Maps component provides comprehensive event handling:
load
Triggered before rendering:
@Component({
template: `
<ejs-maps (load)='onLoad($event)'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
onLoad(args: any) {
console.log('Map is loading...');
// Modify map settings before render
}
}loaded
Triggered after rendering completes:
onLoaded(args: any) {
console.log('Map loaded successfully');
}click
Triggered on map click:
@Component({
template: `
<ejs-maps (click)='onClick($event)'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
onClick(args: any) {
console.log('Clicked at:', args.latitude, args.longitude);
console.log('Target:', args.target);
}
}shapeSelected / markerClick / bubbleClick
Handle element-specific interactions:
@Component({
template: `
<ejs-maps
(shapeSelected)='onShapeSelected($event)'
(markerClick)='onMarkerClick($event)'
(bubbleClick)='onBubbleClick($event)'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
onShapeSelected(args: any) {
console.log('Shape selected:', args.data);
}
onMarkerClick(args: any) {
console.log('Marker clicked:', args.data);
}
onBubbleClick(args: any) {
console.log('Bubble clicked:', args.data);
}
}Zoom Events
@Component({
template: `
<ejs-maps
(zoom)='onZoom($event)'
(pan)='onPan($event)'>
<e-layers>
<e-layer [shapeData]='shapeData'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
onZoom(args: any) {
console.log('Zoom level:', args.scale);
console.log('Type:', args.type); // 'ZoomIn', 'ZoomOut', 'Reset'
}
onPan(args: any) {
console.log('Pan to:', args.x, args.y);
}
}Creating Routes Between Markers
Draw navigation routes connecting multiple markers:
import { Component } from '@angular/core';
import { MapsModule, MarkerService, NavigationLineService } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [MarkerService, NavigationLineService],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<e-layer
[shapeData]='shapeData'
[markerSettings]='markerSettings'
[navigationLineSettings]='navigationLineSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
// Cities to connect
public cities = [
{ name: 'New York', latitude: 40.7128, longitude: -74.0060 },
{ name: 'London', latitude: 51.5074, longitude: -0.1278 },
{ name: 'Tokyo', latitude: 35.6762, longitude: 139.6503 }
];
// Markers for cities
public markerSettings: object[] = [{
visible: true,
shape: 'Circle',
fill: '#FF6347',
height: 15,
width: 15,
dataSource: this.cities
}];
// Routes between cities
public navigationLineSettings: object[] = [
// New York to London
{
visible: true,
latitude: [40.7128, 51.5074],
longitude: [-74.0060, -0.1278],
color: '#4169E1',
width: 3,
angle: -0.2,
showArrow: true,
arrowSettings: {
showArrow: true,
position: 'End',
size: 10
}
},
// London to Tokyo
{
visible: true,
latitude: [51.5074, 35.6762],
longitude: [-0.1278, 139.6503],
color: '#FF6347',
width: 3,
angle: 0.2,
showArrow: true,
arrowSettings: {
showArrow: true,
position: 'End',
size: 10
}
}
];
}Curved Routes
Create curved paths using angle property:
public navigationLineSettings: object[] = [{
visible: true,
latitude: [startLat, endLat],
longitude: [startLng, endLng],
angle: -0.5, // Negative = curve upward, Positive = curve downward
dashArray: '5,5', // Dashed line
color: '#4169E1',
width: 4
}];Custom Path Rendering
Draw custom paths on the map:
import { Component } from '@angular/core';
import { MapsModule, NavigationLineService } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
providers: [NavigationLineService],
template: `
<ejs-maps id='maps-container'>
<e-layers>
<e-layer
[shapeData]='shapeData'
[navigationLineSettings]='navigationLineSettings'>
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public shapeData: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
// Multi-point path
public navigationLineSettings: object[] = [{
visible: true,
latitude: [40.7128, 48.8566, 51.5074, 35.6762],
longitude: [-74.0060, 2.3522, -0.1278, 139.6503],
color: '#FF6347',
width: 3,
dashArray: '10,5',
selectionSettings: {
enable: true,
fill: '#FFD700',
border: { color: '#000000', width: 3 }
}
}];
}Drilldown Navigation
Navigate from world map → country map → state map:
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
import { world_map } from './world-map';
import { usa_map } from './usa-map';
import { california_map } from './california-map';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<div>
<button (click)='goToWorld()'>World</button>
<button (click)='goToUSA()'>USA</button>
<button (click)='goToCalifornia()'>California</button>
</div>
<ejs-maps
id='maps-container'
[baseLayerIndex]='baseLayerIndex'
(shapeSelected)='onShapeSelected($event)'>
<e-layers>
<!-- Layer 0: World -->
<e-layer
[shapeData]='worldMap'
[selectionSettings]='selectionSettings'>
</e-layer>
<!-- Layer 1: USA -->
<e-layer
[shapeData]='usaMap'
[selectionSettings]='selectionSettings'>
</e-layer>
<!-- Layer 2: California -->
<e-layer [shapeData]='californiaMap'></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };;
public usaMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/usa.json' } };;
public californiaMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/california.json' } };;
public baseLayerIndex: number = 0; // Start with world map
public selectionSettings: object = {
enable: true,
fill: '#4CAF50',
opacity: 1
};
onShapeSelected(args: any) {
// Automatic drilldown on shape click
if (this.baseLayerIndex === 0 && args.data && args.data.name === 'United States') {
this.baseLayerIndex = 1; // Go to USA map
} else if (this.baseLayerIndex === 1 && args.data && args.data.name === 'California') {
this.baseLayerIndex = 2; // Go to California map
}
}
goToWorld() {
this.baseLayerIndex = 0;
}
goToUSA() {
this.baseLayerIndex = 1;
}
goToCalifornia() {
this.baseLayerIndex = 2;
}
}Breadcrumb Navigation
Implement breadcrumb for drilldown:
export class AppComponent {
public breadcrumb: string[] = ['World'];
public baseLayerIndex: number = 0;
onShapeSelected(args: any) {
if (this.baseLayerIndex === 0 && args.data.name === 'United States') {
this.baseLayerIndex = 1;
this.breadcrumb = ['World', 'USA'];
}
}
navigateToBreadcrumb(index: number) {
this.baseLayerIndex = index;
this.breadcrumb = this.breadcrumb.slice(0, index + 1);
}
}Best Practices
1. Export Configuration
// ✅ Good: Provide export options
exportWithOptions() {
const fileName = `map-export-${Date.now()}`;
this.maps.export('PNG', fileName);
}2. Event Handling Performance
// ✅ Good: Debounce frequent events
import { debounce } from 'lodash';
constructor() {
this.debouncedZoom = debounce(this.onZoom.bind(this), 300);
}
onZoom(args: any) {
// Handle zoom
}3. State Persistence
// ✅ Good: Clear old state when needed
clearPersistedState() {
localStorage.removeItem('maps-container');
window.location.reload();
}4. Navigation Lines
// ✅ Good: Limit navigation lines
if (routes.length > 100) {
routes = routes.slice(0, 100); // Limit for performance
}5. Drilldown Management
// ✅ Good: Track navigation history
export class AppComponent {
private history: number[] = [0];
drillDown(layerIndex: number) {
this.history.push(layerIndex);
this.baseLayerIndex = layerIndex;
}
drillUp() {
if (this.history.length > 1) {
this.history.pop();
this.baseLayerIndex = this.history[this.history.length - 1];
}
}
}Common Patterns
Pattern 1: Export Dashboard
exportDashboard() {
// Export as multiple formats
Promise.all([
this.maps.export('PNG', 'map'),
this.maps.export('PDF', 'map-report', 'Portrait')
]).then(() => {
console.log('Export complete');
});
}Pattern 2: Interactive Routes
public routes: any[] = [];
addRoute(start: any, end: any) {
this.routes.push({
visible: true,
latitude: [start.lat, end.lat],
longitude: [start.lng, end.lng],
color: this.getRouteColor(),
showArrow: true
});
this.maps.refresh();
}
clearRoutes() {
this.routes = [];
this.maps.refresh();
}Pattern 3: Hierarchical Drilldown
export class AppComponent {
private layers = [
{ name: 'World', data: world_map },
{ name: 'North America', data: north_america_map },
{ name: 'USA', data: usa_map },
{ name: 'California', data: california_map }
];
drillToLayer(layerName: string) {
const index = this.layers.findIndex(l => l.name === layerName);
if (index >= 0) {
this.baseLayerIndex = index;
}
}
}Next Steps
- [User Interactions](user-interactions.md) - Zoom, pan, and selection
- [Markers](markers.md) - Learn about marker drag and drop
- [Customization](customization.md) - Style your maps
- [Getting Started](getting-started.md) - Review basics
---
API Reference Summary
Advanced APIs
| API | Description | Documentation Link |
|---|---|---|
projectionType | Map projection type | projectionType |
centerPosition | Map center point | centerPosition |
print() | Print map | |
export() | Export map (Image/PDF) | export |
refresh() | Refresh map | refresh |
addLayer() | Add layer dynamically | addlayer |
Render Events
| Event | Description | Documentation Link |
|---|---|---|
layerRendering | Fires before layer renders | layerRendering |
shapeRendering | Fires before shape renders | shapeRendering |
beforePrint | Fires before print | beforePrint |
For complete API documentation, see: api-reference.md
Syncfusion Angular Maps - API Reference Guide
This comprehensive guide catalogs all API references for the Syncfusion Angular Maps component. All API documentation is available at https://ej2.syncfusion.com/angular/documentation/api/maps/.
Table of Contents
- Core Component APIs
- Layer Configuration APIs
- Marker APIs
- Bubble APIs
- Data Label APIs
- Legend APIs
- Tooltip APIs
- Zoom Settings APIs
- Selection and Highlight APIs
- Color Mapping APIs
- Navigation Line APIs
- Annotation APIs
- Event APIs
- Enum Types
- Interface Types
---
Core Component APIs
MapsComponent
The main Maps component that renders geographical visualizations.
| API | Type | Description | Documentation Link |
|---|---|---|---|
MapsComponent | Class | Main maps component | MapsComponent |
layers | Property | Collection of map layers | layers |
titleSettings | Property | Title configuration | titleSettings |
zoomSettings | Property | Zoom configuration | zoomSettings |
legendSettings | Property | Legend configuration | legendSettings |
background | Property | Map background color | background |
theme | Property | Built-in theme selection | theme |
width | Property | Map width | width |
height | Property | Map height | height |
centerPosition | Property | Map center point | centerPosition |
baseLayerIndex | Property | Active base layer index | baseLayerIndex |
mapsArea | Property | Map area border and background | mapsArea |
margin | Property | Map margins | margin |
border | Property | Map border styling | border |
projectionType | Property | Map projection type | projectionType |
enablePersistence | Property | Persist component state | enablePersistence |
enableRtl | Property | Right-to-left rendering | enableRtl |
locale | Property | Localization culture | locale |
print() | Method | Print map | |
export() | Method | Export map as image/PDF | export |
refresh() | Method | Refresh map rendering | refresh |
addLayer() | Method | Add new layer dynamically | addlayer |
removeLayer() | Method | Remove layer by index | removelayer |
---
Layer Configuration APIs
LayerSettings
Configuration for map layers (base layer and sublayers).
| API | Type | Description | Documentation Link |
|---|---|---|---|
LayerSettings | Class | Layer configuration model | LayerSettings |
shapeData | Property | GeoJSON shape data | shapeData |
dataSource | Property | External data source | dataSource |
shapeDataPath | Property | Data field for shape matching | shapeDataPath |
shapePropertyPath | Property | GeoJSON property for matching | shapePropertyPath |
type | Property | Layer type (Layer/SubLayer) | type |
geometryType | Property | Geometry type (Geographic/Normal) | geometryType |
urlTemplate | Property | Map tile URL template | urlTemplate |
visible | Property | Show/hide layer | visible |
shapeSettings | Property | Shape styling configuration | shapeSettings |
markerSettings | Property | Marker configuration array | markerSettings |
bubbleSettings | Property | Bubble configuration array | bubbleSettings |
dataLabelSettings | Property | Data label configuration | dataLabelSettings |
navigationLineSettings | Property | Navigation line array | navigationLineSettings |
tooltipSettings | Property | Tooltip configuration | tooltipSettings |
selectionSettings | Property | Selection configuration | selectionSettings |
highlightSettings | Property | Highlight configuration | highlightSettings |
animationDuration | Property | Animation duration (ms) | animationDuration |
ShapeSettings
Shape styling and color mapping configuration.
| API | Type | Description | Documentation Link |
|---|---|---|---|
ShapeSettings | Class | Shape configuration model | ShapeSettings |
fill | Property | Shape fill color | fill |
palette | Property | Color palette array | palette |
border | Property | Shape border styling | border |
dashArray | Property | Border dash pattern | dashArray |
opacity | Property | Shape opacity (0-1) | opacity |
colorValuePath | Property | Data field for color mapping | colorValuePath |
valuePath | Property | Data field for shape values | valuePath |
colorMapping | Property | Color mapping configuration | colorMapping |
autofill | Property | Automatic palette coloring | autofill |
---
Marker APIs
MarkerSettings
Configuration for map markers.
| API | Type | Description | Documentation Link |
|---|---|---|---|
MarkerSettings | Class | Marker configuration model | MarkerSettings |
dataSource | Property | Marker data array | dataSource |
visible | Property | Show/hide markers | visible |
shape | Property | Marker shape (Balloon, Circle, etc.) | shape |
width | Property | Marker width | width |
height | Property | Marker height | height |
fill | Property | Marker fill color | fill |
border | Property | Marker border styling | border |
offset | Property | Marker offset position | offset |
latitudeValuePath | Property | Data field for latitude | latitudeValuePath |
longitudeValuePath | Property | Data field for longitude | longitudeValuePath |
template | Property | Custom marker template | template |
tooltipSettings | Property | Marker tooltip configuration | tooltipSettings |
animationDuration | Property | Marker animation duration | animationDuration |
animationDelay | Property | Marker animation delay | animationDelay |
imageUrl | Property | Image URL for Image marker | imageUrl |
legendText | Property | Legend text for marker | legendText |
---
Bubble APIs
BubbleSettings
Configuration for data bubbles on the map.
| API | Type | Description | Documentation Link |
|---|---|---|---|
BubbleSettings | Class | Bubble configuration model | BubbleSettings |
dataSource | Property | Bubble data array | dataSource |
visible | Property | Show/hide bubbles | visible |
valuePath | Property | Data field for bubble size | valuePath |
minRadius | Property | Minimum bubble radius | minRadius |
maxRadius | Property | Maximum bubble radius | maxRadius |
fill | Property | Bubble fill color | fill |
border | Property | Bubble border styling | border |
opacity | Property | Bubble opacity (0-1) | opacity |
bubbleType | Property | Bubble type (Circle/Square) | bubbleType |
colorValuePath | Property | Data field for color mapping | colorValuePath |
colorMapping | Property | Color mapping configuration | colorMapping |
tooltipSettings | Property | Bubble tooltip configuration | tooltipSettings |
selectionSettings | Property | Bubble selection settings | selectionSettings |
highlightSettings | Property | Bubble highlight settings | highlightSettings |
---
Data Label APIs
DataLabelSettings
Configuration for data labels on shapes.
| API | Type | Description | Documentation Link |
|---|---|---|---|
DataLabelSettings | Class | Data label model | DataLabelSettings |
visible | Property | Show/hide data labels | visible |
labelPath | Property | Data field for label text | labelPath |
smartLabelMode | Property | Label overlap handling | smartLabelMode |
intersectionAction | Property | Overlap intersection action | intersectionAction |
fill | Property | Label background color | fill |
border | Property | Label border styling | border |
opacity | Property | Label opacity | opacity |
textStyle | Property | Label text styling | textStyle |
template | Property | Custom label template | template |
---
Legend APIs
LegendSettings
Legend configuration for maps.
| API | Type | Description | Documentation Link |
|---|---|---|---|
LegendSettings | Class | Legend model | LegendSettings |
visible | Property | Show/hide legend | visible |
position | Property | Legend position | position |
alignment | Property | Legend alignment | alignment |
orientation | Property | Legend orientation | orientation |
height | Property | Legend height | height |
width | Property | Legend width | width |
type | Property | Legend type (Layers/Bubbles/Markers) | type |
mode | Property | Legend mode (Default/Interactive) | mode |
shape | Property | Legend icon shape | shape |
shapeHeight | Property | Legend icon height | shapeHeight |
shapeWidth | Property | Legend icon width | shapeWidth |
shapePadding | Property | Icon-text spacing | shapePadding |
background | Property | Legend background | background |
border | Property | Legend border styling | border |
textStyle | Property | Legend text styling | textStyle |
title | Property | Legend title | title |
titleStyle | Property | Title text styling | titleStyle |
toggleLegendSettings | Property | Interactive legend settings | toggleLegendSettings |
---
Tooltip APIs
TooltipSettings
Tooltip configuration for maps.
| API | Type | Description | Documentation Link |
|---|---|---|---|
TooltipSettings | Class | Tooltip model | TooltipSettings |
visible | Property | Show/hide tooltip | visible |
format | Property | Tooltip text format | format |
template | Property | Custom tooltip template | template |
fill | Property | Tooltip background color | fill |
border | Property | Tooltip border styling | border |
textStyle | Property | Tooltip text styling | textStyle |
valuePath | Property | Data field for tooltip | valuePath |
---
Zoom Settings APIs
ZoomSettings
Zoom and pan configuration.
| API | Type | Description | Documentation Link |
|---|---|---|---|
ZoomSettings | Class | Zoom configuration model | ZoomSettings |
enable | Property | Enable/disable zooming | enable |
zoomFactor | Property | Zoom level factor | zoomFactor |
minZoom | Property | Minimum zoom level | minZoom |
maxZoom | Property | Maximum zoom level | maxZoom |
mouseWheelZoom | Property | Enable mouse wheel zoom | mouseWheelZoom |
doubleClickZoom | Property | Enable double-click zoom | doubleClickZoom |
pinchZoom | Property | Enable pinch zoom | pinchZoom |
zoomOnClick | Property | Enable click-to-zoom | zoomOnClick |
toolbars | Property | Zoom toolbar buttons | toolbars |
horizontalAlignment | Property | Toolbar horizontal position | horizontalAlignment |
verticalAlignment | Property | Toolbar vertical position | verticalAlignment |
toolBarOrientation | Property | Toolbar orientation | toolBarOrientation |
color | Property | Toolbar button color | color |
highlightColor | Property | Toolbar highlight color | highlightColor |
selectionColor | Property | Toolbar selection color | selectionColor |
---
Selection and Highlight APIs
SelectionSettings
Shape selection configuration.
| API | Type | Description | Documentation Link |
|---|---|---|---|
SelectionSettings | Class | Selection model | SelectionSettings |
enable | Property | Enable/disable selection | enable |
fill | Property | Selection fill color | fill |
opacity | Property | Selection opacity | opacity |
enableMultiSelect | Property | Enable multiple selection | enableMultiSelect |
border | Property | Selection border styling | border |
HighlightSettings
Shape highlight configuration.
| API | Type | Description | Documentation Link |
|---|---|---|---|
HighlightSettings | Class | Highlight model | HighlightSettings |
enable | Property | Enable/disable highlight | enable |
fill | Property | Highlight fill color | fill |
opacity | Property | Highlight opacity | opacity |
border | Property | Highlight border styling | border |
---
Color Mapping APIs
ColorMapping
Color mapping configuration for choropleth maps.
| API | Type | Description | Documentation Link |
|---|---|---|---|
ColorMappingSettings | Class | Color mapping model | ColorMappingSettings |
from | Property | Range start value | from |
to | Property | Range end value | to |
value | Property | Equal color mapping value | value |
color | Property | Mapping color | color |
label | Property | Legend label text | label |
minOpacity | Property | Minimum opacity (desaturation) | minOpacity |
maxOpacity | Property | Maximum opacity (desaturation) | maxOpacity |
showLegend | Property | Show in legend | showLegend |
---
Navigation Line APIs
NavigationLineSettings
Configuration for drawing lines between locations.
| API | Type | Description | Documentation Link |
|---|---|---|---|
NavigationLineSettings | Class | Navigation line model | NavigationLineSettings |
visible | Property | Show/hide navigation line | visible |
latitude | Property | Start latitude array | latitude |
longitude | Property | Start longitude array | longitude |
color | Property | Line color | color |
width | Property | Line width | width |
angle | Property | Line angle/curve | angle |
dashArray | Property | Line dash pattern | dashArray |
highlightSettings | Property | Line highlight settings | highlightSettings |
selectionSettings | Property | Line selection settings | selectionSettings |
---
Annotation APIs
Annotation
Configuration for custom HTML annotations.
| API | Type | Description | Documentation Link |
|---|---|---|---|
Annotation | Class | Annotation model | Annotation |
content | Property | Annotation HTML content | content |
x | Property | X position | x |
y | Property | Y position | y |
verticalAlignment | Property | Vertical alignment | verticalAlignment |
horizontalAlignment | Property | Horizontal alignment | horizontalAlignment |
zIndex | Property | Z-index ordering | zIndex |
---
Event APIs
Map Events
| Event | Description | Event Args | Documentation Link |
|---|---|---|---|
load | Fires before map loads | ILoadEventArgs | load |
loaded | Fires after map loads | ILoadedEventArgs | loaded |
shapeSelected | Fires on shape selection | IShapeSelectedEventArgs | shapeSelected |
shapeHighlight | Fires on shape highlight | IShapeSelectedEventArgs | shapeHighlight |
itemSelection | Fires on legend item selection | ILegendItemRenderingEventArgs | itemSelection |
itemHighlight | Fires on legend item highlight | ILegendItemRenderingEventArgs | itemHighlight |
markerClick | Fires on marker click | IMarkerClickEventArgs | markerClick |
markerMouseMove | Fires on marker hover | IMarkerMoveEventArgs | markerMouseMove |
bubbleClick | Fires on bubble click | IBubbleClickEventArgs | bubbleClick |
bubbleMouseMove | Fires on bubble hover | IBubbleMoveEventArgs | bubbleMouseMove |
click | Fires on map click | IMouseEventArgs | click |
doubleClick | Fires on double-click | IMouseEventArgs | doubleClick |
rightClick | Fires on right-click | IMouseEventArgs | rightClick |
zoom | Fires during zoom | IMapZoomEventArgs | zoom |
pan | Fires during pan | IMapPanEventArgs | pan |
tooltipRender | Fires before tooltip renders | ITooltipRenderEventArgs | tooltipRender |
layerRendering | Fires before layer renders | ILayerRenderingEventArgs | layerRendering |
shapeRendering | Fires before shape renders | IShapeRenderingEventArgs | shapeRendering |
markerRendering | Fires before marker renders | IMarkerRenderingEventArgs | markerRendering |
bubbleRendering | Fires before bubble renders | IBubbleRenderingEventArgs | bubbleRendering |
dataLabelRendering | Fires before label renders | IDataLabelRenderingEventArgs | dataLabelRendering |
legendRendering | Fires before legend renders | ILegendRenderingEventArgs | legendRendering |
annotationRendering | Fires before annotation renders | IAnnotationRenderingEventArgs | annotationRendering |
beforePrint | Fires before print | IPrintEventArgs | beforePrint |
resize | Fires on map resize | IResizeEventArgs | resize |
---
Enum Types
Projection Types
Map projection options.
| Value | Description | Documentation Link |
|---|---|---|
Mercator | Mercator projection | ProjectionType |
Equirectangular | Equirectangular projection | ProjectionType |
Miller | Miller projection | ProjectionType |
Eckert3 | Eckert III projection | ProjectionType |
Eckert5 | Eckert V projection | ProjectionType |
Eckert6 | Eckert VI projection | ProjectionType |
Winkel3 | Winkel Tripel projection | ProjectionType |
AitOff | Aitoff projection | ProjectionType |
MarkerType
Marker shape options.
| Value | Description | Documentation Link |
|---|---|---|
Balloon | Balloon marker | MarkerType |
Circle | Circle marker | MarkerType |
Cross | Cross marker | MarkerType |
Diamond | Diamond marker | MarkerType |
Image | Image marker | MarkerType |
Rectangle | Rectangle marker | MarkerType |
Star | Star marker | MarkerType |
Triangle | Triangle marker | MarkerType |
LayerType
Layer type options.
| Value | Description | Documentation Link |
|---|---|---|
Layer | Base layer | LayerType |
SubLayer | Sublayer | LayerType |
GeometryType
Geometry type for rendering.
| Value | Description | Documentation Link |
|---|---|---|
Geographic | Geographic coordinates | GeometryType |
Normal | Normal coordinates (for custom shapes) | GeometryType |
LegendMode
Legend interaction modes.
| Value | Description | Documentation Link |
|---|---|---|
Default | Default legend | LegendMode |
Interactive | Interactive legend with toggle | LegendMode |
LegendType
Legend element type.
| Value | Description | Documentation Link |
|---|---|---|
Layers | Layer shapes legend | LegendType |
Bubbles | Bubble legend | LegendType |
Markers | Marker legend | LegendType |
---
Interface Types
Event Argument Interfaces
| Interface | Purpose | Documentation Link |
|---|---|---|
ILoadEventArgs | Load event arguments | ILoadEventArgs |
ILoadedEventArgs | Loaded event arguments | ILoadedEventArgs |
IShapeSelectedEventArgs | Shape selection/highlight event | IShapeSelectedEventArgs |
IMarkerClickEventArgs | Marker click event | IMarkerClickEventArgs |
IMarkerMoveEventArgs | Marker mouse move event | IMarkerMoveEventArgs |
IBubbleClickEventArgs | Bubble click event | IBubbleClickEventArgs |
IBubbleMoveEventArgs | Bubble mouse move event | IBubbleMoveEventArgs |
IMouseEventArgs | Mouse event arguments | IMouseEventArgs |
IMapZoomEventArgs | Zoom event arguments | IMapZoomEventArgs |
IMapPanEventArgs | Pan event arguments | IMapPanEventArgs |
ITooltipRenderEventArgs | Tooltip render customization | ITooltipRenderEventArgs |
IShapeRenderingEventArgs | Shape render customization | IShapeRenderingEventArgs |
IMarkerRenderingEventArgs | Marker render customization | IMarkerRenderingEventArgs |
ILegendRenderingEventArgs | Legend render customization | ILegendRenderingEventArgs |
Model Interfaces
| Interface | Purpose | Documentation Link |
|---|---|---|
MapsModel | Maps model interface | MapsModel |
LayerSettingsModel | Layer model interface | LayerSettingsModel |
MarkerSettingsModel | Marker model interface | MarkerSettingsModel |
BubbleSettingsModel | Bubble model interface | BubbleSettingsModel |
ZoomSettingsModel | Zoom model interface | ZoomSettingsModel |
LegendSettingsModel | Legend model interface | LegendSettingsModel |
TooltipSettingsModel | Tooltip model interface | TooltipSettingsModel |
---
Quick Reference Links
Essential APIs
- MapsComponent: https://ej2.syncfusion.com/angular/documentation/api/maps/mapsComponent
- LayerSettings: https://ej2.syncfusion.com/angular/documentation/api/maps/layerSettings
- MarkerSettings: https://ej2.syncfusion.com/angular/documentation/api/maps/markerSettings
- BubbleSettings: https://ej2.syncfusion.com/angular/documentation/api/maps/bubbleSettings
- ZoomSettings: https://ej2.syncfusion.com/angular/documentation/api/maps/zoomSettings
- LegendSettings: https://ej2.syncfusion.com/angular/documentation/api/maps/legendSettings
Getting Started
- Main Index: https://ej2.syncfusion.com/angular/documentation/api/maps/index-default
- Getting Started Guide: https://ej2.syncfusion.com/angular/documentation/maps/getting-started
---
Navigation Tips:
- All links point to the official Syncfusion EJ2 Angular documentation
- Use Ctrl+F to search this document for specific APIs
- Click any "Documentation Link" to open the full API reference online
- Refer to interface types for TypeScript type definitions
Customization in Angular Maps
Master appearance customization in Syncfusion Angular Maps to create visually stunning and on-brand geographic visualizations. This comprehensive guide covers themes, sizing, styling, projections, and responsive design.
Table of Contents
- Map Sizing
- Fixed Dimensions
- Responsive Sizing
- Title Configuration
- Main Title
- Subtitle
- Themes
- Built-in Themes
- Theme Switching
- Container Customization
- Background and Borders
- Margins
- Map Area Styling
- Background Colors
- Area Borders
- Shape Customization
- Fill Colors
- Auto Palette
- Border Styling
- Projection Types
- Available Projections
- Choosing Projections
---
Map Sizing
Control map dimensions using width and height properties.
Fixed Dimensions
Set specific pixel or percentage values:
import { Component } from '@angular/core';
import { MapsModule } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps
[width]="width"
[height]="height">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// Your GeoJSON data
// Fixed pixel dimensions
public width: string = '800px';
public height: string = '600px';
// Or use percentages
// public width: string = '100%';
// public height: string = '80vh';
}Responsive Sizing
Create responsive maps that adapt to container size:
@Component({
selector: 'app-root',
template: `
<div class="map-container">
<ejs-maps
width="100%"
height="100%">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
</div>
`,
styles: [`
.map-container {
width: 100%;
height: 600px;
min-height: 400px;
max-height: 800px;
}
@media (max-width: 768px) {
.map-container {
height: 400px;
}
}
`]
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
}---
Title Configuration
Add descriptive titles and subtitles to provide context.
Main Title
Configure the primary map title:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps [titleSettings]="titleSettings">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
public titleSettings: object = {
text: 'World Population Distribution',
alignment: 'Center', // 'Near', 'Center', 'Far'
textStyle: {
fontFamily: 'Segoe UI',
size: '18px',
fontWeight: 'Bold',
color: '#212121',
opacity: 1
},
description: 'Global population data for 2024'
};
}Subtitle
Add a subtitle below the main title:
public titleSettings: object = {
text: 'Global Economic Indicators',
alignment: 'Center',
textStyle: {
size: '20px',
fontWeight: 'Bold',
color: '#1976D2'
},
subtitleSettings: {
text: 'GDP Distribution by Country - 2024',
alignment: 'Center',
textStyle: {
size: '14px',
fontWeight: 'Normal',
color: '#757575',
fontStyle: 'Italic'
}
}
};---
Container Customization
Style the outer map container.
Background and Borders
Customize container appearance:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps
[background]="background"
[border]="border">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
public background: string = '#F5F5F5'; // Light gray background
public border: object = {
color: '#1976D2', // Blue border
width: 2, // Border width in pixels
opacity: 1 // Full opacity
};
}Margins
Control spacing around the map:
public margin: object = {
left: 20, // Left margin in pixels
right: 20, // Right margin in pixels
top: 30, // Top margin in pixels
bottom: 30 // Bottom margin in pixels
};Complete Container Setup:
@Component({
template: `
<ejs-maps
[background]="background"
[border]="border"
[margin]="margin"
width="100%"
height="600px">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public background: string = '#FFFFFF';
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };
public border: object = {
color: '#E0E0E0',
width: 1,
opacity: 0.8
};
public margin: object = {
left: 40,
right: 40,
top: 50,
bottom: 40
};
}---
Map Area Styling
Customize the inner map rendering area.
Background Colors
Set the map area background:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps [mapsArea]="mapsArea">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
public mapsArea: object = {
background: '#E3F2FD', // Light blue background for ocean
border: {
color: '#BBDEFB',
width: 1,
opacity: 1
}
};
}Area Borders
Add borders around the map rendering area:
public mapsArea: object = {
background: '#FFFFFF',
border: {
color: '#424242',
width: 2,
opacity: 0.8
}
};---
Shape Customization
Style the map shapes (countries, states, regions).
Fill Colors
Set uniform fill colors for all shapes:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<ejs-maps>
<e-layers>
<e-layer
[shapeData]="worldMap"
[shapeSettings]="shapeSettings">
</e-layer>
</e-layers>
</ejs-maps>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
public shapeSettings: object = {
fill: '#81C784', // Green fill color
opacity: 0.8 // 80% opacity
};
}Auto Palette
Automatically assign colors from a palette:
public shapeSettings: object = {
autofill: true, // Enable automatic coloring
palette: [
'#E3F2FD', // Light blue
'#BBDEFB', // Blue
'#90CAF9', // Medium blue
'#64B5F6', // Darker blue
'#42A5F5', // Deep blue
'#2196F3' // Primary blue
],
border: {
color: '#1976D2',
width: 0.5
}
};Border Styling
Customize shape borders:
public shapeSettings: object = {
fill: '#E0E0E0',
border: {
color: '#424242', // Dark gray border
width: 1, // Border width in pixels
opacity: 1 // Full opacity
},
dashArray: '0', // Solid line (use '5,5' for dashed)
opacity: 1 // Shape fill opacity
};Data-Driven Shape Colors:
public shapeSettings: object = {
colorValuePath: 'color', // Field in dataSource containing color values
border: {
color: '#FFFFFF',
width: 1
}
};
public dataSource: object[] = [
{ name: 'United States', color: '#2196F3' },
{ name: 'Canada', color: '#4CAF50' },
{ name: 'Mexico', color: '#FF9800' }
];Data-Driven Border Customization:
public shapeSettings: object = {
fill: '#E0E0E0',
borderColorValuePath: 'borderColor', // Field for border color
borderWidthValuePath: 'borderWidth', // Field for border width
border: {
// Default fallback values if fields not found
color: '#424242',
width: 1
}
};
public dataSource: object[] = [
{ name: 'United States', borderColor: '#1976D2', borderWidth: 2 },
{ name: 'Canada', borderColor: '#388E3C', borderWidth: 3 }
];---
Projection Types
Choose how the Earth's surface is projected onto a 2D map.
Available Projections
Syncfusion Maps supports 8 projection types:
import { Component } from '@angular/core';
import { ProjectionType } from '@syncfusion/ej2-angular-maps';
@Component({
selector: 'app-root',
standalone: true,
imports: [MapsModule],
template: `
<div>
<select (change)="changeProjection($event.target.value)">
<option value="Mercator">Mercator</option>
<option value="Equirectangular">Equirectangular</option>
<option value="Miller">Miller</option>
<option value="Eckert3">Eckert III</option>
<option value="Eckert5">Eckert V</option>
<option value="Eckert6">Eckert VI</option>
<option value="Winkel3">Winkel Tripel</option>
<option value="AitOff">Aitoff</option>
</select>
<ejs-maps [projectionType]="projectionType">
<e-layers>
<e-layer [shapeData]="worldMap"></e-layer>
</e-layers>
</ejs-maps>
</div>
`
})
export class AppComponent {
public worldMap: object = { dataOptions: { type: 'GET', url: 'https://cdn.syncfusion.com/maps/map-data/world-map.json' } };// GeoJSON data
public projectionType: ProjectionType = 'Mercator';
public changeProjection(projection: string): void {
this.projectionType = projection as ProjectionType;
}
}Projection Characteristics:
1. Mercator (Default)
- Preserves shape and angles
- Distorts size near poles
- Best for navigation and web maps
2. Equirectangular
- Simple plate carrée projection
- Equal spacing of meridians and parallels
- Moderate distortion
3. Miller
- Compromise between Mercator and cylindrical
- Less distortion at high latitudes
- Good for world maps
4. Eckert III
- Pseudocylindrical equal-area
- Pole lines half the equator
- Minimizes distortion
5. Eckert V
- Pseudocylindrical compromise
- Sinusoidal meridians
- Balanced appearance
6. Eckert VI
- Pseudocylindrical equal-area
- Sinusoidal meridians
- Popular for world maps
7. Winkel Tripel (Winkel3)
- Compromise projection
- Used by National Geographic
- Low overall distortion
8. Aitoff
- Modified azimuthal
- Elliptical world map
- Aesthetic appearance
Choosing Projections
Select projections based on use case:
export class ProjectionSelectorComponent {
// For web mapping and navigation
public webMapProjection: ProjectionType = 'Mercator';
// For statistical/thematic world maps
public thematicProjection: ProjectionType = 'Winkel3';
// For equal-area analysis
public equalAreaProjection: ProjectionType = 'Eckert6';
// For aesthetic presentation
public presentationProjection: ProjectionType = 'Miller';
}---
Best Practices
Visual Design
1. Maintain Consistency: Use consistent colors and styles across related visualizations 2. Ensure Readability: Choose high-contrast colors for text and borders 3. Follow Brand Guidelines: Match corporate color schemes and fonts 4. Use Appropriate Themes: Select themes that match your application's design system 5. Test Across Devices: Verify appearance on different screen sizes and resolutions
Performance Optimization
1. Limit Palette Colors: Use 6-12 colors maximum in auto-palette 2. Optimize Border Width: Keep borders thin (0.5-2px) for better rendering 3. Use Simple Projections: Mercator and Equirectangular render fastest 4. Cache Styles: Store frequently used style objects 5. Minimize Reflows: Batch styling changes before refresh
Accessibility
1. Provide High Contrast: Ensure sufficient color contrast ratios (WCAG 4.5:1) 2. Use Descriptive Titles: Add clear, informative titles 3. Support Dark Mode: Implement dark theme variants 4. Avoid Color-Only Communication: Use patterns or labels in addition to colors 5. Test with Screen Readers: Verify ARIA labels work correctly
Responsive Design
1. Use Relative Units: Prefer percentages over fixed pixels 2. Set Min/Max Dimensions: Prevent maps from becoming too small or large 3. Adjust Margins: Reduce margins on smaller screens 4. Scale Text: Use viewport-relative font sizes (vw, vh) 5. Test Breakpoints: Verify appearance at common device widths
---
Common Patterns
Corporate Branding
Apply corporate colors and styling:
export class CorporateMapComponent {
// Corporate color palette
private brandColors = {
primary: '#1976D2',
secondary: '#FFC107',
accent: '#FF5722',
background: '#F5F5F5',
text: '#212121'
};
public titleSettings: object = {
text: 'Global Operations',
textStyle: {
color: this.brandColors.text,
fontFamily: 'Roboto, sans-serif',
size: '20px',
fontWeight: 'Bold'
}
};
public background: string = this.brandColors.background;
public border: object = {
color: this.brandColors.primary,
width: 2
};
public shapeSettings: object = {
palette: [
this.brandColors.primary + '33', // Primary with transparency
this.brandColors.secondary + '33',
this.brandColors.accent + '33'
],
autofill: true,
border: {
color: this.brandColors.primary,
width: 1
}
};
}Dark Mode Implementation
Create a dark mode variant:
export class DarkModeMapComponent {
public isDarkMode: boolean = false;
public get titleSettings(): object {
return {
text: 'Population Map',
textStyle: {
color: this.isDarkMode ? '#FFFFFF' : '#212121',
size: '18px'
}
};
}
public get background(): string {
return this.isDarkMode ? '#212121' : '#FFFFFF';
}
public get mapsArea(): object {
return {
background: this.isDarkMode ? '#303030' : '#F5F5F5',
border: {
color: this.isDarkMode ? '#424242' : '#E0E0E0',
width: 1
}
};
}
public get shapeSettings(): object {
return {
fill: this.isDarkMode ? '#424242' : '#E0E0E0',
border: {
color: this.isDarkMode ? '#BDBDBD' : '#9E9E9E',
width: 0.5
}
};
}
public toggleDarkMode(): void {
this.isDarkMode = !this.isDarkMode;
}
}Themed Map Collections
Create multiple themed variations:
export class ThemedMapCollectionComponent {
public themes = {
ocean: {
mapsArea: { background: '#E3F2FD' },
shapeSettings: {
fill: '#81C784',
border: { color: '#4CAF50', width: 1 }
}
},
desert: {
mapsArea: { background: '#FFF9C4' },
shapeSettings: {
fill: '#FFB74D',
border: { color: '#FF9800', width: 1 }
}
},
monochrome: {
mapsArea: { background: '#FAFAFA' },
shapeSettings: {
palette: ['#BDBDBD', '#9E9E9E', '#757575', '#616161', '#424242'],
autofill: true,
border: { color: '#212121', width: 0.5 }
}
}
};
public currentTheme: string = 'ocean';
public get mapsArea(): object {
return this.themes[this.currentTheme].mapsArea;
}
public get shapeSettings(): object {
return this.themes[this.currentTheme].shapeSettings;
}
}---
Next Steps
- [Data Visualization](./data-visualization.md) - Apply colors through color mapping
- [User Interactions](./user-interactions.md) - Customize selection and highlight styles
- [Map Providers](./map-providers.md) - Style tile-based maps
- [Accessibility](./accessibility.md) - Implement accessible color schemes
- [Advanced Features](./advanced-features.md) - Export customized maps
For complete API documentation, visit the Syncfusion Angular Maps API Reference.
---
API Reference Summary
Appearance APIs
| API | Description | Documentation Link |
|---|---|---|
theme | Built-in theme selection | theme |
background | Map background color | background |
ShapeSettings | Shape styling model | ShapeSettings |
palette | Color palette array | palette |
border | Border styling | border |
titleSettings | Title configuration | titleSettings |
For complete API documentation, see: api-reference.md