In additional to world and country maps, amCharts 5 geodata package comes with a set of specialized regional maps, such as second-level subdivisions (districts), e.g. counties. This tutorial will show how those can be used.
Pre-requisites
We're assuming, you have basic knowledge of how the map chart works, about its data loading, and series.
Please visit "Map chart" tutorial for more information.
Loading
Regional maps are located in their respective sub-directories, e.g. region/usa/*
.
The global name of the regional map will reflect its sub-directory structure.
For example, congressional district map of Florida would load like this:
import am5geodata_region_usa_congressional2022_worldLow from "@amcharts/amcharts5-geodata/region/usa/congressional2022/flLow";
<script src="https://cdn.amcharts.com/lib/5/geodata/region/usa/congressional2022/worldLow.js"></script>
Available map sets
Directory | Global variable name | Comment |
---|---|---|
region/canada | am5_region_canada_* | Counties of Canada |
region/mexico | am5_region_mexico_* | Counties of Mexico |
region/usa | am5_region_usa_* | Counties of the USA |
region/usa/congressional | am5_region_usa_congressional_* | Congressional districts of the USA (117th congress) |
region/usa/congressional2022 | am5_region_usa_congressional2022_* | Congressional districts of the USA (118th congress) |
region/world | am5_region_world_* | Maps of various regions of the World, e.g. Europe |
Country-specific map sets usually contain maps for each state/province as well as a single map of the whole country with all second-level subdivisions.
Examples
U.S. Congressional district map
See the Pen U.S. Congressional Map by amCharts team (@amcharts) on CodePen.
U.S. Congressional district drill-down map
See the Pen U.S. Congressional district drill-down map by amCharts team (@amcharts) on CodePen.
County map of Florida
See the Pen County map of Florida by amCharts team (@amcharts) on CodePen.
Map of Africa
See the Pen Map of Africa by amCharts team (@amcharts) on CodePen.
County map of Jalisco, Mexico
See the Pen County map of Jalisco, Mexico by amCharts team (@amcharts) on CodePen.