/syncfusion-javascript:syncfusion-javascript-mapsfrom Syncfusion JavaScript UI Controls
Guide to implementing Syncfusion Maps in TypeScript and JavaScript. Use this skill whenever the user needs to create interactive maps, add markers, visualize geographical data, work with map layers, apply color mapping, add annotations, configure legends, or handle map interactions and events. Works with TypeScript (module-based) and JavaScript (CDN/ES5).
Ships in Syncfusion JavaScript UI Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Syncfusion EJ2 Maps component visualizes geographic information through online tile providers, GeoJSON shape layers, markers, bubbles, custom polygons, navigation lines, labels, legends, annotations, tooltips, selection, zooming, panning, printing, and exporting.
This skill covers framework-neutral implementations for:
Use TypeScript when the application uses:
@syncfusion/ej2-maps npm package.Install the package:
npm install @syncfusion/ej2-maps
Basic import:
import {
Maps
} from '@syncfusion/ej2-maps';
Feature modules must be imported and injected before constructing Maps.
import {
Maps,
Marker,
Zoom
} from '@syncfusion/ej2-maps';
Maps.Inject(
Zoom,
Marker
);
Use global JavaScript when the application uses:
ej.maps.Maps constructor.Global constructor:
ej.maps.Maps
Use the complete versioned EJ2 global bundle:
<script src="https://cdn.syncfusion.com/ej2/34.2.2/dist/ej2.min.js"></script>
Do not mix the complete bundle with separate ej2-base, ej2-data, ej2-svg-base, and ej2-maps scripts.
Global JavaScript using the complete bundle does not require explicit Maps.Inject(...) calls.
The global JavaScript examples use ES5-compatible syntax where practical:
var declarations
Traditional functions
No TypeScript annotations
No ECMAScript module imports
Global ej namespace
Browser support must still match the supported-browser matrix of the installed EJ2 release.
Do not promise unrestricted legacy-browser compatibility.
Use this skill when the task requires:
Use markers for locations defined directly by latitude and longitude.
Examples:
Use bubbles for numeric values associated with GeoJSON shapes.
Examples:
Bubbles are not direct replacements for coordinate markers.
Use shapeData for:
Use polygonSettings.polygons for application-defined areas based on coordinate points.
Examples:
Use navigation lines to display:
Zooming and panning -> Zoom
Markers -> Marker
Bubbles -> Bubble
Navigation lines -> NavigationLine
Tooltips -> MapsTooltip
Legends -> Legend
Annotations -> Annotations
Selection -> Selection
Data labels -> DataLabel
Custom polygons -> Polygon
Printing -> Print
Image export -> ImageExport
PDF export -> PdfExport
Import and inject only the modules used by an example.
Example:
import {
Maps,
MapsTooltip,
Marker,
Zoom
} from '@syncfusion/ej2-maps';
Maps.Inject(
Zoom,
Marker,
MapsTooltip
);
Keep imports and injection synchronized.
Incorrect:
import {
Maps
} from '@syncfusion/ej2-maps';
Maps.Inject(
Marker
);
Correct:
import {
Maps,
Marker
} from '@syncfusion/ej2-maps';
Maps.Inject(
Marker
);
Preferred TypeScript:
const map: Maps =
new Maps({
layers
});
map.appendTo(
'#maps-container'
);
Preferred JavaScript:
var map =
new ej.maps.Maps({
layers: layers
});
map.appendTo(
'#maps-container'
);
const host:
HTMLElement | null =
document.getElementById(
'maps-container'
);
if (!host) {
throw new Error(
'The Maps host element "#maps-container" was not found.'
);
}
#maps-container {
width: 100%;
min-height: 600px;
}
Configure Maps with a definite height:
width:
'100%',
height:
'600px'
Avoid relying on:
height:
'100%'
unless every relevant ancestor has a definite computed height.
Incorrect:
center: {
latitude: 37.7749,
longitude: -122.4194
}
Correct:
centerPosition: {
latitude: 37.7749,
longitude: -122.4194
}
Shape data -> Layer shapeData
Shape binding data -> Layer dataSource
Shape tooltip -> Layer tooltipSettings
Shape selection -> Layer selectionSettings
Markers -> Layer markerSettings array
Marker tooltip -> Marker entry tooltipSettings
Marker selection -> Marker entry selectionSettings
Bubbles -> Layer bubbleSettings array
Bubble tooltip -> Bubble entry tooltipSettings
Bubble selection -> Bubble entry selectionSettings
Navigation lines -> Layer navigationLineSettings array
Custom polygons -> Layer polygonSettings
Shape labels -> Layer dataLabelSettings
Read:
references/getting-started.md
Use this reference for:
Read:
references/data-and-layers.md
Use this reference for:
baseLayerIndex.Read:
references/markers-and-navigation.md
Use this reference for:
Read:
references/visualization-features.md
Use this reference for:
Read:
references/legends-and-annotations.md
Use this reference for:
Read:
references/map-providers-and-selection.md
Use this reference for:
Read:
references/customization-and-persistence.md
Use this reference for:
Read:
references/troubleshooting.md
Use this reference for:
This example renders OpenStreetMap with a marker, marker tooltip, zooming, and panning.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
>
<title>Syncfusion Maps</title>
./styles.css
</head>
<body>
<main class="page-container">
<section
class="maps-card"
aria-labelledby="maps-heading"
aria-describedby="maps-description"
>
<h1 id="maps-heading">
Office Location
</h1>
<p id="maps-description">
An interactive OpenStreetMap view showing the
San Francisco office location.
</p>
<div id="maps-container"></div>
<p class="map-attribution">
Map data © OpenStreetMap contributors
</p>
<p
id="maps-status"
aria-live="polite"
>
Loading the map.
</p>
</section>
</main>
<script scr="app.ts"></script>
</body>
</html>
html,
body {
margin: 0;
min-height: 100%;
}
body {
color: #111827;
background: #f1f5f9;
font-family:
"Segoe UI",
Arial,
sans-serif;
}
.page-container {
width: 100%;
min-height: 100vh;
padding: 24px;
box-sizing: border-box;
}
.maps-card {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 16px;
box-sizing: border-box;
background: #ffffff;
border: 1px solid #cbd5e1;
border-radius: 8px;
}
.maps-card h1 {
margin: 0 0 8px;
font-size: 24px;
}
.maps-card > p {
color: #475569;
line-height: 1.5;
}
#maps-container {
width: 100%;
min-height: 600px;
}
.map-attribution {
margin: 8px 0 0;
font-size: 12px;
}
@media (max-width: 768px) {
.page-container {
padding: 12px;
}
.maps-card {
padding: 12px;
}
#maps-container {
min-height: 500px;
}
}
import {
Maps,
MapsTooltip,
Marker,
Zoom
} from '@syncfusion/ej2-maps';
Maps.Inject(
Zoom,
Marker,
MapsTooltip
);
interface LocationData {
id: string;
name: string;
latitude: number;
longitude: number;
}
const locationData:
LocationData[] = [
{
id:
'san-francisco-office',
name:
'San Francisco Office',
latitude:
37.7749,
longitude:
-122.4194
}
];
const validateLocations = (
locations:
LocationData[]
): void => {
const ids:
Set<string> =
new Set<string>();
locations.forEach(
(
location:
LocationData
): void => {
if (
!location.id.trim()
) {
throw new Error(
'Every marker requires a nonempty ID.'
);
}
if (
ids.has(
location.id
)
) {
throw new Error(
'Duplicate marker ID: ' +
location.id
);
}
if (
!location.name.trim()
) {
throw new Error(
'Every marker requires a name.'
);
}
if (
!Number.isFinite(
location.latitude
) ||
location.latitude < -90 ||
location.latitude > 90
) {
throw new Error(
'Invalid marker latitude.'
);
}
if (
!Number.isFinite(
location.longitude
) ||
location.longitude < -180 ||
location.longitude > 180
) {
throw new Error(
'Invalid marker longitude.'
);
}
ids.add(
location.id
);
}
);
};
validateLocations(
locationData
);
const host:
HTMLElement | null =
document.getElementById(
'maps-container'
);
const statusElement:
HTMLElement | null =
document.getElementById(
'maps-status'
);
if (!host) {
throw new Error(
'The Maps host element "#maps-container" was not found.'
);
}
const map: Maps =
new Maps({
width: '100%',
height: '600px',
centerPosition: {
latitude: 37.7749,
longitude: -122.4194
},
zoomSettings: {
enable: true,
enablePanning: true,
mouseWheelZoom: true,
pinchZooming: true,
minZoom: 1,
maxZoom: 13,
zoomFactor: 5,
toolbarSettings: {
buttonSettings: {
toolbarItems: [
'Zoom',
'ZoomIn',
'ZoomOut',
'Pan',
'Reset'
]
}
}
},
layers: [
{
urlTemplate:
'https://tile.openstreetmap.org/level/tileX/tileY.png',
markerSettings: [
{
visible: true,
dataSource:
locationData,
latitudeValuePath:
'latitude',
longitudeValuePath:
'longitude',
width: 24,
height: 24,
shape: 'Circle',
fill: '#dc2626',
border: {
color: '#ffffff',
width: 2
},
tooltipSettings: {
visible: true,
valuePath:
'name'
}
}
]
}
],
loaded: (): void => {
if (
statusElement
) {
statusElement.textContent =
'The map loaded successfully.';
}
}
});
map.appendTo(
host
);
This example provides equivalent behavior in one standalone HTML file.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
>
<title>Syncfusion Maps</title>
<style>
html,
body {
margin: 0;
min-height: 100%;
}
body {
color: #111827;
background: #f1f5f9;
font-family:
"Segoe UI",
Arial,
sans-serif;
}
.page-container {
width: 100%;
min-height: 100vh;
padding: 24px;
box-sizing: border-box;
}
.maps-card {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 16px;
box-sizing: border-box;
background: #ffffff;
border: 1px solid #cbd5e1;
border-radius: 8px;
}
#maps-container {
width: 100%;
min-height: 600px;
}
.map-attribution {
color: #475569;
font-size: 12px;
}
@media (max-width: 768px) {
.page-container {
padding: 12px;
}
#maps-container {
min-height: 500px;
}
}
</style>
<script src="https://cdn.syncfusion.com/ej2/34.2.2/dist/ej2.min.js"></script>
</head>
<body>
<main class="page-container">
<section
class="maps-card"
aria-labelledby="maps-heading"
aria-describedby="maps-description"
>
<h1 id="maps-heading">
Office Location
</h1>
<p id="maps-description">
An interactive OpenStreetMap view showing the
San Francisco office location.
</p>
<div id="maps-container"></div>
<p class="map-attribution">
Map data © OpenStreetMap contributors
</p>
<p
id="maps-status"
aria-live="polite"
>
Loading the map.
</p>
</section>
</main>
<script>
var locationData = [
{
id:
'san-francisco-office',
name:
'San Francisco Office',
latitude:
37.7749,
longitude:
-122.4194
}
];
function validateLocations(
locations
) {
var ids =
new Set();
locations.forEach(
function (location) {
if (
typeof location.id !==
'string' ||
location.id
.trim()
.length === 0
) {
throw new Error(
'Every marker requires a nonempty ID.'
);
}
if (
ids.has(
location.id
)
) {
throw new Error(
'Duplicate marker ID: ' +
location.id
);
}
if (
!Number.isFinite(
location.latitude
) ||
location.latitude < -90 ||
location.latitude > 90
) {
throw new Error(
'Invalid marker latitude.'
);
}
if (
!Number.isFinite(
location.longitude
) ||
location.longitude < -180 ||
location.longitude > 180
) {
throw new Error(
'Invalid marker longitude.'
);
}
ids.add(
location.id
);
}
);
}
validateLocations(
locationData
);
var host =
document.getElementById(
'maps-container'
);
var statusElement =
document.getElementById(
'maps-status'
);
if (!host) {
throw new Error(
'The Maps host element "#maps-container" was not found.'
);
}
if (
typeof window.ej ===
'undefined' ||
!window.ej.maps
) {
throw new Error(
'The EJ2 Maps global bundle was not loaded.'
);
}
var map =
new ej.maps.Maps({
width: '100%',
height: '600px',
centerPosition: {
latitude: 37.7749,
longitude: -122.4194
},
zoomSettings: {
enable: true,
enablePanning: true,
mouseWheelZoom: true,
pinchZooming: true,
minZoom: 1,
maxZoom: 13,
zoomFactor: 5,
toolbarSettings: {
buttonSettings: {
toolbarItems: [
'Zoom',
'ZoomIn',
'ZoomOut',
'Pan',
'Reset'
]
}
}
},
layers: [
{
urlTemplate:
'https://tile.openstreetmap.org/level/tileX/tileY.png',
markerSettings: [
{
visible: true,
dataSource:
locationData,
latitudeValuePath:
'latitude',
longitudeValuePath:
'longitude',
width: 24,
height: 24,
shape: 'Circle',
fill: '#dc2626',
border: {
color:
'#ffffff',
width: 2
},
tooltipSettings: {
visible: true,
valuePath:
'name'
}
}
]
}
],
loaded:
function () {
statusElement.textContent =
'The map loaded successfully.';
}
});
map.appendTo(
host
);
</script>
</body>
</html>
OpenStreetMap does not require a world-map file.
GeoJSON shape, color-mapping, shape-label, and bubble examples require complete shapeData.
Download a world-map GeoJSON file:
mkdir -p src/data
curl -L "https://datahub.io/core/geo-countries/_r/-/data/countries.geojson" -o "src/data/world-map.geojson"
Manual download:
https://datahub.io/core/geo-countries/_r/-/data/countries.geojson
Validate it:
import {
readFile
} from 'node:fs/promises';
const content =
await readFile(
'src/data/world-map.geojson',
'utf8'
);
const worldMap =
JSON.parse(
content
);
if (
worldMap.type !==
'FeatureCollection'
) {
throw new Error(
'The world-map file must be a GeoJSON FeatureCollection.'
);
}
if (
!Array.isArray(
worldMap.features
) ||
worldMap.features.length === 0
) {
throw new Error(
'The world-map file does not contain features.'
);
}
For TypeScript JSON imports, enable:
{
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true
}
}
Then import:
import worldMap
from './data/world-map.json';
Use a GeoJSON layer with complete data binding.
layers: [
{
shapeData:
worldMap,
dataSource:
regionData,
shapePropertyPath:
'name',
shapeDataPath:
'country',
shapeSettings: {
fill: '#e2e8f0',
colorValuePath:
'value',
colorMapping: [
{
from: 0,
to: 39,
color: '#dbeafe',
label: 'Low'
},
{
from: 40,
to: 69,
color: '#60a5fa',
label: 'Moderate'
},
{
from: 70,
to: 100,
color: '#1d4ed8',
label: 'High'
}
]
}
}
]
Use singular:
colorMapping
Do not use:
colorMappings
Use a validated main layer and SubLayer overlays.
layers: [
{
shapeData:
worldMap
},
{
type: 'SubLayer',
shapeData:
overlayGeoJson,
shapeSettings: {
fill:
'rgb(37 99 235 / 30%)'
}
}
]
Do not create empty layers merely to separate marker and bubble configuration.
Use:
Zoom -> Zooming and panning
MapsTooltip -> Tooltips
Selection -> Visual selection
Keep click events and visual selection separate.
Use external persistent details when information is important. Do not rely only on hover tooltips.
navigationLineSettings: [
{
latitude: [
37.7749,
34.0522
],
longitude: [
-122.4194,
-118.2437
],
color: '#2563eb',
width: 3,
opacity: 0.8,
dashArray: '8 4'
}
]
Validate:
-90 and 90.-180 and 180.0 and 1.Distance and duration are application-owned values. Navigation lines do not automatically calculate route distance, travel duration, or road directions.
Use for geographic points based on latitude and longitude.
Use for magnitude visualization associated with GeoJSON shapes.
Use for geographic boundaries supplied through shapeData.
Use for coordinate-defined overlays supplied through polygonSettings.polygons.
Use range, equal-value, or opacity-based shape and bubble coloring.
Use main layers and validated SubLayer overlays.
Use coordinate paths to connect locations.
Use to explain layer, bubble, or marker colors and symbols.
Use for map-relative HTML overlays positioned through x and y.
Annotations do not use latitude and longitude. Use markers for geographic points.
Use for contextual information associated with shapes, markers, or bubbles.
Use enablePersistence when built-in component persistence meets the application requirement.
Use validated application-owned storage for custom preferences, schema versioning, expiration, layer visibility, or user-specific settings.
Use:
Print -> Print module and allowPrint
ImageExport -> ImageExport module and allowImageExport
PdfExport -> PdfExport module and allowPdfExport
✅ @syncfusion/ej2-maps is installed.
✅ Maps is imported.
✅ Every enabled TypeScript feature has its module imported.
✅ Every imported runtime module is injected before construction.
✅ Unused optional modules are not injected.
✅ Global JavaScript does not call Maps.Inject.
✅ The complete EJ2 bundle loads before application code.
✅ Combined and individual bundles are not mixed.
✅ Every CDN script URL ends in .min.js.
✅ The Maps host exists.
✅ The appendTo target matches the host ID.
✅ The host has measurable width and height.
✅ Maps width and height use valid CSS-size strings.
✅ centerPosition is used instead of center.
✅ Zoom is injected when zooming or panning is enabled.
✅ Tile URLs are plain strings.
✅ OpenStreetMap URLs contain level, tileX, and tileY.
✅ OpenStreetMap attribution is visible.
✅ Provider terms and network requirements are reviewed.
✅ Maps provider credentials are protected as far as the provider permits.
✅ The layer contains urlTemplate or shapeData.
✅ GeoJSON is a nonempty FeatureCollection.
✅ shapePropertyPath matches a GeoJSON feature property.
✅ shapeDataPath matches application data.
✅ markerSettings is an array.
✅ Every active marker entry uses visible: true.
✅ Marker coordinate paths match marker data.
✅ Marker IDs are nonempty and unique when required.
✅ Marker latitudes are finite and between -90 and 90.
✅ Marker longitudes are finite and between -180 and 180.
✅ bubbleSettings is an array.
✅ Every active bubble entry uses visible: true.
✅ Bubble data is associated with GeoJSON shapes.
✅ Bubble valuePath matches finite numeric values.
✅ colorMapping uses the singular property name.
✅ Color ranges are finite and nonoverlapping.
✅ Navigation-line coordinate arrays have matching lengths.
✅ Annotations use x and y rather than latitude and longitude.
✅ Layer indexes are validated before runtime updates.
✅ Storage preferences are validated before use.
✅ Print and export flags match injected modules.
✅ Runtime updates are batched.
✅ refresh is called once after complete updates.
✅ Important information is not communicated only by color, size, or hover.
✅ Application-owned listeners and timers are cleaned up.
✅ Pending requests are cancelled where appropriate.
✅ map.destroy() is called when a dynamic host is removed.
✅ No encoded HTML replaces executable markup.
✅ No rich-text anchors or editor-generated classes remain.
refresh() once.map.destroy();
Incorrect:
center: {
latitude: 37.7749,
longitude: -122.4194
}
Correct:
centerPosition: {
latitude: 37.7749,
longitude: -122.4194
}
Incorrect:
import {
Maps
} from '@syncfusion/ej2-maps';
const map: Maps =
new Maps({
zoomSettings: {
enable: true
}
});
Correct:
import {
Maps,
Zoom
} from '@syncfusion/ej2-maps';
Maps.Inject(
Zoom
);
Incorrect:
markerSettings: {
dataSource:
locationData
}
Correct:
markerSettings: [
{
visible: true,
dataSource:
locationData
}
]
Incorrect:
bubbleSettings: {
dataSource:
bubbleData
}
Correct:
bubbleSettings: [
{
visible: true,
dataSource:
bubbleData
}
]
Incorrect:
markerSettings: [
{
dataSource:
locationData
}
]
Correct:
markerSettings: [
{
visible: true,
dataSource:
locationData
}
]
Incorrect:
urlTemplate:
'https://tile.openstreetmap.org/......</a>'
Correct:
urlTemplate:
'https://tile.openstreetmap.org/level/tileX/tileY.png'
Avoid:
type:
'OSM'
Use:
urlTemplate:
'https://tile.openstreetmap.org/level/tileX/tileY.png'
Incorrect:
Bubbles can always be positioned like markers by supplying
latitude and longitude on a basic tile layer.
Correct:
Use markers for direct coordinates.
Use bubbles for values associated with GeoJSON shapes.
Incorrect:
colorMappings: []
Correct:
colorMapping: []
Incorrect:
shapePropertyPath:
'properties.name'
Correct:
shapePropertyPath:
'name'
Incorrect:
annotations: [
{
latitude:
37.7749,
longitude:
-122.4194
}
]
Use a marker for geographic coordinates.
Use x and y for an annotation:
annotations: [
{
content:
'#annotation-template',
x:
'5%',
y:
'10%'
}
]
Incorrect:
map.navigationLineSettings =
routes;
Correct:
map.layers[0]
.navigationLineSettings =
routes;
Avoid:
shapeData:
worldMap
unless worldMap has been imported, defined, or fetched successfully.
Do not assume these events exist:
zoomEnd
panEnd
mouseMove
layerRender
Validate events and event types against the installed package.
Incorrect:
https://cdn.syncfusion.com/...
https://cdn.syncfusion.com/...
</a>
Correct:
<script src="https://cdn.syncfusion.com/ej2/34.2.2/dist/ej2.min.js"></script>
Incorrect:
<script src="https://cdn.syncfusion.com/ej2/34.2.2/dist/ej2.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/34.2.2/ej2-base/dist/global/ej2-base.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/34.2.2/ej2-maps/dist/global/ej2-maps.min.js"></script>
Correct:
<script src="https://cdn.syncfusion.com/ej2/34.2.2/dist/ej2.min.js"></script>
Incorrect:
<div id="maps-container"></div>
Correct:
<div id="maps-container"></div>
When the dynamic view is removed:
button.removeEventListener(
'click',
handleClick
);
controller.abort();
map.destroy();
Remove the following from executable HTML, TypeScript, JavaScript, CSS, imports, commands, templates, and URLs:
<a>
<strong data-lexical-text="true">
<br>
data-lexical-text
Editor-generated class names
Encoded executable tags
references/API-Refernce_JavaScript.md (opens in a new tab)references/API-Refernce_TypeScript.md (opens in a new tab)references/api-reference-guide.md (opens in a new tab)references/customization-and-persistence.md (opens in a new tab)references/data-and-layers.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/legends-and-annotations.md (opens in a new tab)references/map-providers-and-selection.md (opens in a new tab)references/markers-and-navigation.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/visualization-features.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-javascriptOther plugins' skills for the same job
67 skills in this plugin
/syncfusion-javascript-3d-chartCreate interactive 3D charts in Syncfusion TypeScript and JavaScript. Immediately use this skill when user needs to build 3D visualizations, render 3D column/bar charts, configure 3D rotation and depth, visualize data in three dimensions, customize 3D chart appearance, handle 3D interactions, or implement advanced 3D features. Works with TypeScript (webpack/module-based) and JavaScript (CDN/ES5)./syncfusion-javascript-accordionBuild collapsible navigation panels with the Syncfusion TypeScript Accordion component. Use this skill when implementing vertical accordion menus, expanding/collapsing content panels, multi-step wizards, data-driven panels with dynamic content, tabbed navigation alternatives, or nested hierarchical content structures. Covers initialization, expand modes, animations, icons, templates, styling, data binding, and advanced use cases like form wizards./syncfusion-javascript-accumulation-chartImplements Syncfusion JavaScript accumulation charts (Pie, Doughnut, Funnel, Pyramid) for proportional and percentage-based visualizations. Use when displaying categorical or proportional data. Covers legend and label configuration, interactivity, accessibility, and customization. Works with TypeScript (modules) and JavaScript (CDN/ES5).