{"id":25917,"date":"2025-01-09T13:40:31","date_gmt":"2025-01-09T13:40:31","guid":{"rendered":"https:\/\/www.highcharts.com\/blog\/?p=25917"},"modified":"2026-01-13T12:00:28","modified_gmt":"2026-01-13T12:00:28","slug":"us-map-of-top-100-cities-using-highcharts","status":"publish","type":"post","link":"https:\/\/www.highcharts.com\/blog\/tutorials\/us-map-of-top-100-cities-using-highcharts\/","title":{"rendered":"US map of top 100 cities using Highcharts"},"content":{"rendered":"<p>Creating an interactive map of US cities using Highcharts allows users to visualize geographic and demographic data effectively. <a href=\"https:\/\/www.highcharts.com\/products\/maps\/\">Highcharts\u00ae Maps<\/a>, with its tile-based mapping, provides excellent performance and scalability for large datasets, making it ideal for mapping projects like visualizing the population of the top 100 cities in the US.<\/p>\n<p>In this post, we will discuss how <a href=\"https:\/\/www.highcharts.com\/products\/maps\/\">Highcharts\u00ae Maps<\/a>, combined with tiled web maps, can be used to display city-level data &#8211; such as city names, state abbreviations, and populations &#8211; in an interactive, customizable format.<\/p>\n<p>To see more examples and get an even better understanding of the opportunities Highcharts offers, please head over to the <a href=\"https:\/\/www.highcharts.com\/demo\">demo section<\/a> of our website or read up on the <a href=\"https:\/\/www.highcharts.com\/docs\/index\">technical documentation<\/a> on how to get started. Once you get the hang of it, the <a href=\"https:\/\/api.highcharts.com\/highcharts\/\">API reference<\/a> will help you customize your charts in no time.<\/p>\n<p>Whether you\u2019re a developer working with JavaScript, .NET, React or other common frameworks, we\u2019re confident you\u2019ll find the inspiration you need.<\/p>\n<p>Highcharts also integrates seamlessly with popular languages such as Python, R, PHP and Java, as well as mobile platforms like iOS and Android. Additional support for frameworks like Svelte, Angular, and Vue, makes it a versatile tool for various development environments.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Why map US cities?<\/b><\/h2>\n<p>Visualizing city-level data helps users better understand population trends, regional dynamics, and geographic distributions. Whether it\u2019s for business analysis, urban planning, or educational purposes, mapping US cities offers a clear and intuitive way to present complex data.<\/p>\n<p>Interactive maps allow users to explore data points by region, focus on specific cities, and extract valuable insights through zooming, panning, and hovering over individual data points. In this post\u2019s example, we focus on the top 100 most populated cities in the US, using tooltips to display each city\u2019s name, state abbreviation, and population.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Highcharts and tiled web maps\u00a0<\/b><\/h2>\n<p>Highcharts is widely recognized for its ability to handle large, complex data sets in an interactive, user-friendly manner. Tile-based mapping allows users to integrate real-world tile providers, like OpenStreetMap, which break down the map into smaller sections (tiles) for more efficient loading and rendering.<\/p>\n<p>This technique offers several advantages:<\/p>\n<ul>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><b>Scalability<\/b>: The map loads only the necessary tiles, allowing for smooth performance even with large datasets.<\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><b>Customization<\/b>: Markers, tooltips, and zoom features can be tailored to the user\u2019s needs.<\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><b>Detail<\/b>: Users can zoom into specific regions or cities without losing data granularity.<\/li>\n<\/ul>\n<p>For this map of US cities, Highcharts uses the Web Mercator projection, a standard for web mapping applications. By integrating OpenStreetMap as the tile provider, the map tiles load dynamically as the user navigates the map, ensuring a seamless experience even with detailed data at city-level granularity.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Map example<\/b><\/h2>\n<p>This US map of cities will focus on the following data points:<\/p>\n<ol>\n<li style=\"margin-bottom: 20px;\"><b>City name<\/b>: Each city is represented on the map by its name.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>State abbreviation<\/b>: The state abbreviation (e.g., NY for New York) helps identify the city\u2019s location within the US.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>Population<\/b>: Population data will be included for each city, displayed in a tooltip when users hover over the city marker. Notice how the size of the marker is adjusted for city\u00a0 population size.<\/li>\n<\/ol>\n<p>By focusing on these key data points, users can interactively explore population distributions and identify the largest cities in the US.<\/p>\n<p>&nbsp;<\/p>\n<p><iframe style=\"width: 100%;\" title=\"US map of top 100 cities using Highcharts\" src=\"https:\/\/www.highcharts.com\/samples\/embed\/highcharts\/blog\/map-us-cities\" height=\"550\" frameborder=\"no\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Here\u2019s how to recreate the map<\/b><\/h2>\n<p><b>Load the required files<\/b><\/p>\n<p>For basics, see <a href=\"https:\/\/highcharts.com\/docs\/getting-started\/installation\">Highcharts installation<\/a>. The framework requirements and installation is the same for Highcharts\u00ae Maps as for Highcharts.<\/p>\n<p>Note that this example in addition to the base Highchart script and the <a href=\"https:\/\/www.highcharts.com\/docs\/maps\/tiledwebmap\">tiledwebmap.js<\/a> module also includes some additional scripts, namely the\u00a0 <a href=\"https:\/\/www.highcharts.com\/docs\/export-module\/export-module-overview\">Export modules (docs)<\/a> and <a href=\"https:\/\/www.highcharts.com\/docs\/accessibility\/accessibility-module\">Accessibility module (docs)<\/a>.<\/p>\n<pre><code>&lt;script src=\"https:\/\/code.highcharts.com\/maps\/highmaps.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/code.highcharts.com\/maps\/modules\/exporting.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/code.highcharts.com\/maps\/modules\/accessibility.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/code.highcharts.com\/maps\/modules\/tiledwebmap.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><b>Insert some CSS to control the container that holds the map<\/b><\/p>\n<pre><code>\r\n#container {\r\n    height: 600px;\r\n    max-width: 900px;\r\n    margin: 0 auto;\r\n}\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><b>Load and initialize the map<\/b><\/p>\n<pre><code>\r\n(async () =&gt; {\r\n    try {\r\n        \/\/ Fetching data for the top 100 cities from external JSON file\r\n        const data = await fetch(\r\n'https:\/\/cdn.jsdelivr.net\/gh\/highcharts\/highcharts@0dc2518d8353\/samples\/data\/us-population-city-100.json'\r\n        ).then(response =&gt; response.json());\r\n\r\n        \/\/ Create the map chart\r\n        Highcharts.mapChart('container', {\r\n            chart: {\r\n                height: '50%'\r\n            },\r\n            title: {\r\n                text: 'US map of top 100 cities by population'\r\n            },\r\n            mapNavigation: {\r\n                enabled: true,\r\n                enableMouseWheelZoom: true,\r\n                enableDoubleClickZoom: true,\r\n                buttonOptions: {\r\n                    verticalAlign: 'bottom'\r\n                }\r\n            },\r\n            legend: {\r\n                enabled: false\r\n            },\r\n            mapView: {\r\n                fitToGeometry: { \t  \/\/ Centering and fitting map to screen\r\n                    type: 'Polygon',\r\n                    coordinates: [[\r\n                        [-125, 25], \/\/ Southwest corner\r\n                        [-125, 45], \/\/ Northwest corner\r\n                        [-66, 45],  \/\/ Northeast corner\r\n                        [-66, 25],  \/\/ Southeast corner\r\n                        [-125, 25]  \/\/ Closing the polygon\r\n                    ]]\r\n                },\r\n                padding: 5\r\n            },\r\n            tooltip: {\r\n                headerFormat: '',\r\n                pointFormat: '<b>{point.name}<\/b>\r\nPopulation: {point.z:,f}'\r\n            },\r\n            plotOptions: {\r\n                mapbubble: {\r\n                    minSize: '5%',\r\n                    maxSize: '15%',\r\n                    allAreas: false,\r\n                    dataLabels: {\r\n                        enabled: false\r\n                    }\r\n                }\r\n            },\r\n            series: [\r\n                {\r\n                    type: 'tiledwebmap',\r\n                    provider: {\r\n                        type: 'OpenStreetMap',\r\n                        theme: 'Standard'\r\n                    }\r\n                },\r\n                {\r\n                    type: 'mapbubble',\r\n                    name: 'Cities',\r\n                    color: Highcharts.getOptions().colors[1],\r\n                    data: data.map(city =&gt; ({\r\n                        name: `${city.city}, ${city.stateAbbr}`,\r\n                        lat: city.lat,\r\n                        lon: city.lon,\r\n                        z: city.population \/\/ Population used for bubble size\r\n                    })),\r\n                    marker: {\r\n                        symbol: 'circle',\r\n                        lineWidth: 1,\r\n                        lineColor: '#ffffff'\r\n                    }\r\n                }\r\n            ],\r\n            chartOptions: {\r\n                legend: {\r\n                    enabled: false\r\n                }\r\n            }\r\n        });\r\n    } catch (error) {\r\n        console.error('Error creating map chart:', error);\r\n    }\r\n})();\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2><b>Interactive features of the map<\/b><\/h2>\n<p>Highcharts offers several interactive features to enhance the user experience:<\/p>\n<ol>\n<li style=\"margin-bottom: 20px;\"><b>Tooltips<\/b>: Tooltips are critical for providing additional information without overcrowding the map. In this example, hovering over a city will display its name, state abbreviation, and population in an easy-to-read format.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>Markers<\/b>: Circular markers are used to indicate the locations of the cities. These markers are customizable, allowing for changes in size, color, or style to suit the project\u2019s needs.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>Zoom and pan functionality<\/b>: Users can zoom into specific regions or pan across the country, making it easier to explore densely populated areas like the East Coast or compare different regions.<\/li>\n<\/ol>\n<p>These features make it easy to explore US city data on the map, allowing users to delve deeper into specific regions or cities while maintaining an overview of the entire country.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Optimizing map performance<\/b><\/h2>\n<p>The <b>tiled web map<\/b> approach significantly improves map performance, especially when visualizing large datasets like city populations. Instead of loading the entire map at once, tiles are loaded as needed based on the user&#8217;s zoom level and the map\u2019s viewport. This ensures faster load times and smoother interaction, especially when zooming in on specific cities or regions.<\/p>\n<p>Performance optimization techniques include:<\/p>\n<ul>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><b>Lazy loading<\/b>: Only the necessary data points and map tiles are loaded when required, improving performance and reducing initial load times.<\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><b>Efficient rendering<\/b>: Highcharts handles the rendering of city markers dynamically, ensuring smooth navigation even when displaying numerous data points.<\/li>\n<\/ul>\n<p>These features make Highcharts an excellent tool for creating responsive, interactive maps that handle large datasets without performance issues.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Customizing the map<\/b><\/h2>\n<p>Highcharts provides a high level of customization, allowing developers to tailor the map\u2019s appearance and functionality. For this US city map, circular markers are used to represent the cities, with a white border to enhance visibility. Tooltips are formatted to display population data in a user-friendly way, with commas separating the numbers for readability.<\/p>\n<p>Other customization options include adjusting the zoom level to ensure the entire US is visible by default, but still allowing users to zoom in for more detailed exploration of specific areas.<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Practical applications of US city maps<\/b><\/h2>\n<p>Mapping US cities has a wide range of applications across industries. Here are some practical use cases:<\/p>\n<ol>\n<li style=\"margin-bottom: 20px;\"><b>Business analysis<\/b>: Companies can use city maps to track customer locations, sales performance, or regional market penetration. Maps can highlight underserved areas or regions where business opportunities exist.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>Urban planning<\/b>: City maps are essential tools for government agencies and planners. Maps can show population density, growth patterns, and urban infrastructure needs, helping decision-makers allocate resources efficiently.<\/li>\n<li style=\"margin-bottom: 20px;\"><b>Education and research<\/b>: City maps can be used in educational settings to teach population distribution, geographic trends, and urbanization. Researchers can also use these maps to explore correlations between population data and other variables like economic activity or environmental impact.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Conclusion and additional resources<\/strong><\/h2>\n<p>Creating a US map of cities using Highcharts and tiled web maps provides a powerful tool for visualizing detailed geographic data. Whether you are tracking population distribution, regional sales, or other demographic data, an interactive map offers clear insights and enhances data exploration. By leveraging the scalability and customization features of Highcharts, you can build a dynamic, high-performance map that handles large datasets effectively. From displaying population data to enabling zoom and pan features, Highcharts allows you to create a responsive, user-friendly map tailored to your specific needs.<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/docs\/maps\/getting-started\">Documentation &#8211; Getting started with Highcharts\u00ae Maps<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/api.highcharts.com\/highmaps\/\">Highcharts\u00ae Maps API Reference<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/demo#highcharts-maps-demo-general\">Different maps in the demo\/example section<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/tutorials\/highcharts-maps-python-basic-tutorial\/\">Basic tutorial &#8211; Using\u00a0 Highcharts\u00ae Maps\u00ae for Python<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/maps-docs.highchartspython.com\/en\/latest\/\">Highcharts\u00ae Maps for Python<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/tutorials\/small-multiples-map-with-highcharts-and-react\/\">Small multiples map with Highcharts and React<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong>Related posts<\/strong><\/h2>\n<ul>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/post\/heat-map-examples-using-highcharts\">Heat map examples using Highcharts<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/post\/choropleth-map-examples-using-highcharts\/\">Choropleth map examples using Highcharts<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/tutorials\/maps-with-latitude-longitude-using-highcharts\">Maps with latitude &amp; longitude using Highcharts<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/tutorials\/lightning-map-create-your-own-using-highcharts\/\">Lightning map &#8211; create your own using Highcharts<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/post\/polygon-chart-using-highcharts\">Polygon chart using Highcharts<\/a><\/li>\n<li style=\"margin-left: 20px; margin-bottom: 20px;\"><a href=\"https:\/\/www.highcharts.com\/blog\/inspirations\/graphing-in-javascript-with-highcharts\">Graphing in JavaScript with Highcharts<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating an interactive map of US cities using Highcharts allows users to visualize geographic and demographic data effectively. Highcharts\u00ae Maps, with its tile-based mapping, provides excellent performance and scalability for large datasets, making it ideal for mapping projects like visualizing the population of the top 100 cities in the US. In this post, we will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":25939,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"meta_title":"","meta_description":"","hc_selected_options":[],"footnotes":""},"categories":[210],"tags":[876,1031],"coauthors":[695],"class_list":["post-25917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-highcharts-maps","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/25917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/comments?post=25917"}],"version-history":[{"count":3,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/25917\/revisions"}],"predecessor-version":[{"id":25942,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/25917\/revisions\/25942"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media\/25939"}],"wp:attachment":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media?parent=25917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/categories?post=25917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/tags?post=25917"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/coauthors?post=25917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}