79553528

Date: 2025-04-03 16:40:39
Score: 0.5
Natty:
Report link

I'm not sure if this is the best or only way to do it, but I followed this doc (https://www.amcharts.com/docs/v4/tutorials/creating-custom-maps/) and was able to figure out a solution.

I downloaded a GeoJSON file of the USA, opened it in mapshaper.org to make a few tweaks to the shapes, and then saved it in a .JS file like that doc directs.

Then, I used the worldLow orthographic projection with my custom map overlaid as a MapPolygonSeries.

   // Create map instance
  let chart = am4core.create("chartdiv", am4maps.MapChart);
  
  // Set base map (worldLow)
  chart.geodata = am4geodata_worldLow;
  chart.projection = new am4maps.projections.Orthographic();

 let worldSeries = chart.series.push(new am4maps.MapPolygonSeries());
  worldSeries.useGeodata = true;

// Overlay series (Custom USA with states)
  let usaSeries = chart.series.push(new am4maps.MapPolygonSeries());
  usaSeries.geodata = am4geodata_worldUSA;  // Your custom dataset
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Adam Hansen