Rotate Globe to a Selected Country
One of the cool features of amCharts Maps is that you can display the world map as a globe. This, however, means that not all countries are in view all the time. This demo shows how to rotate the globe to a country.
Click on any country for the globe to center it.
Key implementation details
When the country polygon becomes selected (active) we get its geometric center with geoCentroid() and then animate the map chart to the latitude/longitude of that point.
Related tutorials
Build this chart with AI
The prompt below can be used to build this chart with AI. For best coding results, use the most advanced AI models, like Claude Opus 4.6 and GPT-5.3-Codex. For more info and tips, check out amCharts AI docs.
Create an interactive 3D globe map that displays all countries as clickable polygons. When a user clicks on a country, smoothly animate the globe to center on that country. Only one country should be selected at a time, with the previous selection automatically deactivating. Show country names in tooltips on hover. Apply a hover state color change and maintain the same highlight color for the active selected country. Include a subtle graticule grid. Support manual panning via mouse interaction to rotate the globe. Use amCharts 5 library.
Demo source