Overview
Map series are used to display different types of geographic data on a MapChart. amCharts 5 provides several series types for different use cases.MapPolygonSeries
Creates a map series for displaying polygons (countries, states, regions).Creating a MapPolygonSeries
Settings
Map data in GeoJSON format.
If set to
true, the order of coordinates in GeoJSON will be flipped.Some GeoJSON software produces coordinates in reverse order, so if your custom map appears garbled, try this setting.An array of map object IDs from geodata to include in the map.If set, only those objects listed in
include will be shown.An array of map object IDs from geodata to omit when showing the map.
A field in series data that holds the map object’s numeric value.It can be used in tooltips, heat rules, etc.
Names of geodata items to replace from loaded geodata.Can be used to override built-in English names for countries.See Map translations for more info.
If
true, this series will affect the calculated bounds shown in the MapChart.Set to false to ignore a series while calculating the bounds (useful for background series).Properties
A ListTemplate of all polygons in the series.Use
mapPolygons.template to configure polygon appearance.Methods
Zooms the map so that all polygons in the array are visible.
Returns a MapPolygon that is under specific X/Y point.
Returns a MapPolygon that contains the specified geographical point.
Data Item Fields
GeoJSON geometry of the polygon.
Related MapPolygon object.
MapPointSeries
Creates a map series for displaying markers on the map.Creating a MapPointSeries
Settings
A field in data that holds the point’s latitude.
A field in data that holds the point’s longitude.
A field in data that holds an ID of a related polygon.If set, the point will be positioned in the visual center of the target polygon.
If set to
true, will hide all points that are in the visible range of the map.If set to
true, will hide all points that are in the invisible range of the map.For example, on the side of the globe facing away from the viewer when used with Orthographic projection.Note: not all projections have an invisible side.If set to
true, bullets will resize when zooming the MapChart.Methods
Centers the map to a specific series data item and zooms to the specified level.
Zooms the map so that all points in the array are visible.
Data Item Fields
GeoJSON geometry of the point.
Longitude of the point.
Latitude of the point.
Relative position (0-1) on a MapLine to place the point on.
Automatically rotate the point bullet to face the direction of the line it is attached to.
The angle will be added to the automatically-calculated angle. Can be used to reverse the direction.
A data item from a MapLineSeries the point is attached to.
An ID of a MapLine the point is attached to.
A data item from a MapPolygonSeries to use for positioning of the point.
An ID of the MapPolygon to use for centering the point.
If set to
true, the point will be drawn according to its x and y coordinates, not its latitude and longitude.Fixed points will not move together with the map, and cannot be used to connect points on a MapLineSeries.MapLineSeries
Creates a map series for displaying lines on the map.Creating a MapLineSeries
Settings
If set to
true, will hide line segments that are in the invisible range of the map.For example, on the side of the globe facing away from the viewer when used with Orthographic projection.Note: not all projections have an invisible side.A line type.
"curved"(default) - connects points using shortest distance, which will result in curved lines based on map projection"straight"- connects points using visually straight lines, and will not cross the -180/180 longitude
Properties
A ListTemplate of all lines in the series.Use
mapLines.template to configure line appearance.Data Item Fields
GeoJSON geometry of the line.
Related MapLine object.
An array of data items from MapPointSeries to use as line end-points.Note: fixed points cannot be used here.
A line type for this specific data item.
GraticuleSeries
A MapChart series to draw a map grid (lines of latitude and longitude).Creating a GraticuleSeries
Settings
Place a grid line every Xth latitude/longitude.
If set to
true, the graticule will be clipped to the visible map bounds.ClusteredPointSeries
Extends MapPointSeries to automatically group nearby points into clusters.Creating a ClusteredPointSeries
Settings
Bullets that are closer than X pixels apart will be automatically grouped.See Minimal distance for more info.
Series data can contain a field with an ID of a virtual group the bullet belongs to.For example, we might want bullets to group only with other bullets from the same continent.
groupIdField specifies which field in source data holds group IDs.See Group segregation for more info.Set this to a Bullet instance which will be used to show groups.See Group bullet for more info.
Set this to a Bullet instance which will be used to show single (non-clustered) points.
If set, clustering will stop when zoom level reaches this value.See Stop clustering for more info.
Distance in pixels between scattered bullets when cluster is opened.See Cluster scatter for more info.
Radius in pixels for scattering bullets when cluster is opened.
Common Series Settings
All map series inherit from the baseMapSeries class and share these common settings:
Map data in GeoJSON format.
An array of map object IDs from geodata to include in the map.
An array of map object IDs from geodata to omit when showing the map.
A field in series data that will hold the map object’s numeric value.
Names of geodata items to replace from loaded geodata.
Whether this series affects the calculated bounds shown in the MapChart.
Events
Invoked when geodata is finished loading and processed.