{"id":17064,"date":"2023-12-22T09:44:20","date_gmt":"2023-12-22T09:44:20","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=17064"},"modified":"2023-12-22T11:41:11","modified_gmt":"2023-12-22T11:41:11","slug":"point-map-js","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/","title":{"rendered":"How to Build Point Map with JavaScript"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\"><img decoding=\"async\" class=\"alignnone size-full wp-image-17069\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png\" alt=\"\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png 1366w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-300x169.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-768x432.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-1024x576.png 1024w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/a>If you&#8217;re a budding developer or data enthusiast eager to explore map creation, you&#8217;re in the right place. In this tutorial, I&#8217;ll guide you through how to easily build an interactive <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/dot-map\/\">point map<\/a> using JavaScript.<\/p>\n<p>To make things even more interesting, I\u2019ll use data on the number of millionaires in cities as an example. By the end of this tutorial, you&#8217;ll have made a visually stunning JS point map, ready to tell the story of the world\u2019s wealthiest cities and a solid understanding of applying these skills to any data and scenarios. And stick around for a bonus at the end \u2014 I&#8217;ll also show you how to transform your point map into\u00a0a <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/bubble-map\/\">bubble map<\/a> where the size of the markers conveys additional information.<\/p>\n<p>Ready to master the JS point mapping technique? Let&#8217;s get started, and don&#8217;t forget to join me in the bonus section where size matters!<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>What Is Point Map?<\/h2>\n<p>As we delve into the realm of building an interactive JavaScript-based point map, it&#8217;s essential to grasp the concept of point maps and their multifaceted role. A <strong>point map<\/strong> is a form of data visualization that represents data on a map using markers (dots), also known as a <strong>marker map<\/strong> and a <strong>dot map<\/strong>, offering a concise and potent method for showcasing spatial information. The purpose of point maps lies in their ability to reveal spatial patterns, provide an intuitive understanding of data distribution, facilitate comparisons, and uncover localized insights.<\/p>\n<p>Beyond these core purposes, point maps find applications in various fields. They serve various purposes, from analyzing population density in urban planning to studying disease spread in epidemiology, revealing demographic trends in sociology, mapping environmental concentrations in environmental science, to visualizing business analytics data such as customer distribution or market trends.<\/p>\n<h2>A. Creating Basic JavaScript Point Map<\/h2>\n<p>Building a point map with JS might seem intimidating at first, especially envisioning cities lighting up based on their millionaire count. But fear not! Whether you&#8217;re a coding novice or a seasoned developer, this guide breaks down the process into manageable steps:<\/p>\n<ol>\n<li>Create a web page in HTML<\/li>\n<li>Include the necessary JavaScript files<\/li>\n<li>Load the data<\/li>\n<li>Write some JS code to create the point map<\/li>\n<\/ol>\n<h3>1. Create Web Page in HTML<\/h3>\n<p>Start by laying the foundation by crafting a basic HTML page for your JS point map. There, add an HTML block-level element into the body, which will be the home for your point map. Assign a unique ID to this element, which will be referenced later when bringing the map to life with JavaScript. Feel free to infuse your creativity with some CSS styling to ensure the map looks exactly how you envision it.<\/p>\n<p>Below is an example of how your HTML page might look. The &lt;div&gt; element, with an id of &#8220;container,&#8221; ensures the map gracefully spans the entire screen, with its height and width set to 100%. Remember, this is your canvas, and you&#8217;re encouraged to modify the styling to reflect your personal touch or match the theme of your project.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Point Map&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>2. Include Necessary JavaScript Files<\/h3>\n<p>Now that your HTML structure is in place, it\u2019s time to infuse it with the prowess of JavaScript. Include any JS files you are going to use.<\/p>\n<p>For example, think of JavaScript charting libraries as secret ingredients that can help you transform raw data into visually delightful creations with little effort. In this tutorial, I\u2019ll illustrate using one of those listed in the <a href=\"https:\/\/onextrapixel.com\/8-javascript-libraries-for-interactive-map-visualizations\/?ref=hackernoon.com\" target=\"_blank\" rel=\"nofollow\">top JS mapping libraries<\/a> \u2014 <a href=\"https:\/\/www.anychart.com\">AnyChart<\/a>.<\/p>\n<p>You have two options for adding JavaScript files: downloading them for local use or linking them via CDN. In the code below, the latter is used, embedding links to the required scripts directly in the &lt;head&gt; section of the HTML page. The scripts being included are the necessary modules of the JavaScript charting library, map geodata, and the open-source Proj4js component that converts point coordinates.<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Point Map&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h3>3. Load Data<\/h3>\n<p>Ready to illuminate your point map? Fuel it with data! For tutorial illustration purposes, I decided to map data from the <a href=\"https:\/\/www.henleyglobal.com\/publications\/wealthiest-cities\" target=\"_blank\" rel=\"nofollow\">World\u2019s Wealthiest Cities Report 2023<\/a> by Henley Global, representing millionaire populations of 97 cities across Africa, Australasia, CIS, East Asia, Europe, the Middle East, North America, South Asia, and Southeast Asia. The data is neatly organized in JSON format and readily available on my <a href=\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\" target=\"_blank\" rel=\"nofollow\">GitHub Gist<\/a>.<\/p>\n<p>Delving into the data, it unfolds as a collection of objects, each signifying a city. Within each city object, you&#8217;ll discover details like the city&#8217;s name, country, coordinates, and the count of millionaires, centimillionaires, and billionaires.<\/p>\n<p>If you use a script to help you load the data, don\u2019t forget to include it in the &lt;head&gt; section in addition to the others. Here, I\u2019ll load my JSON using the data adapter script:<\/p>\n<pre><code class=\"html\">&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<p>Then here\u2019s how the data is loaded:<\/p>\n<pre><code class=\"javascript\">anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\");<\/code><\/pre>\n<p>With this, the groundwork is complete! The stage is set for the next exciting phase, where a touch of JavaScript will bring your point map to life.<\/p>\n<h3>4. Write Some JS Code to Create a Point Map<\/h3>\n<p>Before delving into the JS point map charting code, ensure it runs only after the entire web page is loaded. The anychart.onDocumentReady() function serves this purpose.<\/p>\n<pre><code class=\"html\">&lt;script&gt;\r\n  anychart.onDocumentReady(function () {\r\n    \/\/ The point map data and code will be in this section\r\n  });\r\n&lt;\/script&gt;<\/code><\/pre>\n<p>After confirming the page load, the first task is to import the data prepared in Step 3.<\/p>\n<pre><code class=\"javascript\">anychart.onDocumentReady(function() {\r\n  anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\",\r\n    function(data) {\",\r\n      \/\/ The rest of our code will go here\r\n    }\r\n  );\r\n});<\/code><\/pre>\n<p>Now, embark on the map creation.<\/p>\n<pre><code class=\"javascript\">var map = anychart.map();<\/code><\/pre>\n<p>After creating a basic map instance, set the geographical data. For this visualization, the world map is used.<\/p>\n<pre><code class=\"javascript\">map.geoData(\"anychart.maps.world\");<\/code><\/pre>\n<p>After setting the geodata, map your data using a marker series.<\/p>\n<pre><code class=\"javascript\">var mapSeries = map.marker(data);<\/code><\/pre>\n<p>With the data plotted, place your map inside the &lt;div&gt; container defined in Step 1 and draw the result.<\/p>\n<pre><code class=\"javascript\">map.container(\"container\");\r\nmap.draw();<\/code><\/pre>\n<p>There you have it! With these lines of JavaScript, a visually appealing point map is crafted, illustrating the world&#8217;s wealthiest cities based on their millionaire count. Find the interactive version of this map <a href=\"https:\/\/playground.anychart.com\/E7GMjoFx\" target=\"_blank\" rel=\"nofollow\">here<\/a>, where you can experiment with its code further. The entire block of HTML\/CSS\/JS code constructing this point map is also presented below for your reference.<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-E7GMjoFx\" src=\"https:\/\/playground.anychart.com\/E7GMjoFx\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-E7GMjoFx{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Point Map&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    anychart.onDocumentReady(function() {\r\n      \/\/ load data from json\r\n      anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\",\r\n        function(data) {\r\n          \/\/ create a map chart\r\n          var map = anychart.map();\r\n          \/\/ set the global map geodata\r\n          map.geoData(\"anychart.maps.world\");\r\n          \/\/ create a marker map series\r\n          var series = map.marker(data);\r\n          \/\/ specify a container\r\n          map.container(\"container\");\r\n          \/\/ draw the resulting map\r\n          map.draw();\r\n        }\r\n      );\r\n    });\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>B. Customizing JS Point Map<\/h2>\n<p>Now that your JavaScript point map is ready, let me demonstrate a few ways you can refine it to augment its visuals and functionalities, offering users a more immersive experience.<\/p>\n<h3>Add Title<\/h3>\n<p>Add a dynamic and visually appealing title to the point map. This step enhances the user experience by providing context and additional information about the map, contributing to a more informative and engaging visual experience.<\/p>\n<pre><code class=\"javascript\">map.title()\r\n  .enabled(true)\r\n  .useHtml(true)\r\n  .text(\r\n    \"Wealthiest Cities&lt;br\/&gt;\" +\r\n    \"&lt;span style='color: #929292; font-size: 12px;'&gt;\" +\r\n    \"Based on the number of millionaires&lt;\/span&gt;\"\r\n  );<\/code><\/pre>\n<h3>Add Zoom Controls<\/h3>\n<p>To enhance the user&#8217;s navigation experience, incorporate dedicated zoom controls into the point map. This addition makes it easier for users to navigate large or intricate maps, allowing them to zoom in or out and focus on specific areas effortlessly. Don\u2019t forget to include the necessary scripts\/files in the &lt;head&gt; section if required by your JavaScript charting library.<\/p>\n<pre><code class=\"html\">&lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-ui.min.js\"&gt;&lt;\/script&gt;\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/css\/anychart-ui.min.css\"\/&gt;\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/fonts\/css\/anychart-font.min.css\"\/&gt;<\/code><\/pre>\n<pre><code class=\"javascript\">var zoomController = anychart.ui.zoom();\r\nzoomController.render(map);<\/code><\/pre>\n<h3>Customize Colors<\/h3>\n<p>Improve the visual appeal of your point map by tweaking default settings and adjusting colors to make the data pop out. Consider changing the color of the land area and background to ensure that the main features of the map remain easily distinguishable.<\/p>\n<pre><code class=\"javascript\">map.unboundRegions()\r\n  .enabled(true)\r\n  .fill(\"#E1E1E1\")\r\n  .stroke(\"#D2D2D2\u201d);\r\n\r\nmap.background()\r\n  .fill({\r\n    color: \"#daedea\", \r\n    opacity: 0.5  \r\n  });<\/code><\/pre>\n<h3>Enhance Tooltip<\/h3>\n<p>Customize the point map\u2019s tooltip to make it more informative and user-friendly. In this case, by default, the tooltip displays the latitude and longitude of a city, which may not be very helpful. The following code example demonstrates how to make the tooltip display the name of the city and country, along with the count of millionaires, centimillionaires, and billionaires.<\/p>\n<pre><code class=\"javascript\">map.tooltip()\r\n  .useHtml(true)\r\n  .titleFormat(function () {\r\n    return this.getData(\"name\") +\r\n      \" (\" +\r\n      this.getData(\"Country\") +\r\n      \")\";\r\n  })\r\n  .format(function () {\r\n    return (\r\n      \"&lt;span style='color: #bfbfbf'&gt;Millionaires: &lt;\/span&gt;\" +\r\n      this.getData(\"Millionaires\") +\r\n      \"&lt;br\/&gt;\" +\r\n      \"&lt;span style='color: #bfbfbf'&gt;Centimillionaires: &lt;\/span&gt;\" +\r\n      this.getData(\"Centimillionaires\") +\r\n      \"&lt;br\/&gt;\" +\r\n      \"&lt;span style='color: #bfbfbf'&gt;Billionaires: &lt;\/span&gt;\" +\r\n      this.getData(\"Billionaires\")\r\n    );\r\n  });<\/code><\/pre>\n<h3>Color by Value<\/h3>\n<p>This is going to be a very interesting customization, where the dots in your point map can be colored according to the associated values. When it comes to the data being visualized in this tutorial, cities will be colored based on the number of millionaires they harbor. This necessitates adjustments to the existing code, particularly in how datasets and series are handled.<\/p>\n<p>Begin by creating a dataset.<\/p>\n<pre><code class=\"javascript\">var citiesDataSet = anychart.data.set(data).mapAs();<\/code><\/pre>\n<p>Next, create a helper function that takes in the name, data, and color, and creates a series based on those parameters. The function below initially creates a series based on the provided data and then proceeds to configure the series settings for visuals.<\/p>\n<pre><code class=\"javascript\">var createSeries = function (name, data, color) {\r\n\r\n  \/\/ set the marker series\r\n  var series = map.marker(data);\r\n\r\n  \/\/ configure the series settings\r\n  series\r\n    .name(name)\r\n    .type(\"circle\")\r\n    .fill(color)\r\n    .stroke(anychart.color.darken(color, 0.4))\r\n    .labels(false);\r\n        \r\n  \/\/ configure the series legend items\r\n  series\r\n    .legendItem()\r\n    .iconType(\"circle\")\r\n    .iconFill(color)\r\n    .iconStroke(anychart.color.darken(color, 0.4))\r\n      \r\n};<\/code><\/pre>\n<p>Now, you may wonder what needs to be passed as data in this context. To address this, introduce a new helper, data filtering function. In the code below, the filterFunction() is a higher-order function that returns another function based on its input parameters.<\/p>\n<pre><code class=\"javascript\">function filterFunction(val1, val2) {\r\n  if (val2) {\r\n    return function (fieldVal) {\r\n      return val1 &lt;= fieldVal &amp;&amp; fieldVal &lt; val2;\r\n    };\r\n  }\r\n  return function (fieldVal) {\r\n    return val1 &lt;= fieldVal;\r\n  };\r\n}<\/code><\/pre>\n<p>Now, create the series, filtering the data by value.<\/p>\n<p>Below, each series is determined with three parameters. The first is the name; in the first series, for example, the name \u201cOver 100,000\u201d signifies that this group of series includes cities with millionaire numbers over 100,000. The second is the data, where the filter function is employed; before that, \u201cMillionaires\u201d is passed to ensure data filtering for millionaire numbers, considering other parameters in the dataset; the filter function returns the cities with the respective millionaire numbers. Finally, the third parameter is the color.<\/p>\n<pre><code class=\"javascript\">createSeries(\r\n  \"Over 100,000\",\r\n  citiesDataSet.filter(\"Millionaires\", filterFunction(100000, 1000000)),\r\n  \"#D1FAE9\"\r\n);\r\ncreateSeries(\r\n  \"50,000\u2013100,000\",\r\n  citiesDataSet.filter(\"Millionaires\", filterFunction(50000, 100000)),\r\n  \"#9CE0E5\"\r\n);\r\ncreateSeries(\r\n  \"10,000\u201350,000\",\r\n  citiesDataSet.filter(\"Millionaires\", filterFunction(10000, 50000)),\r\n  \"#00ACC3\"\r\n);\r\ncreateSeries(\r\n  \"1,000\u201310,000\",\r\n  citiesDataSet.filter(\"Millionaires\", filterFunction(1000, 10000)),\r\n  \"#355CB1\"\r\n);\r\ncreateSeries(\r\n  \"Up to 1,000\",\r\n  citiesDataSet.filter(\"Millionaires\", filterFunction(0, 1000)),\r\n  \"#002D79\"\r\n);<\/code><\/pre>\n<p>And don\u2019t forget to add a legend, allowing users to understand the significance of each color on the point map.<\/p>\n<pre><code class=\"javascript\">map.legend(true);<\/code><\/pre>\n<p>The result is a captivating JavaScript-based point map visualization, providing a unique perspective on the distribution of millionaires. Access the interactive version with the code <a href=\"https:\/\/playground.anychart.com\/XaC2h7Ud\" target=\"_blank\" rel=\"nofollow\">here<\/a>, where you can feel free to explore and experiment with the various settings to observe their impact on the visualization. For reference, the complete code for the finalized point map is also provided below.<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-XaC2h7Ud\" src=\"https:\/\/playground.anychart.com\/XaC2h7Ud\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-XaC2h7Ud{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Point Map&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-ui.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/css\/anychart-ui.min.css\"\/&gt;\r\n  &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/fonts\/css\/anychart-font.min.css\"\/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    anychart.onDocumentReady(function() {\r\n      \/\/ load data from a json file\r\n      anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\",\r\n        function(data) {\r\n          \/\/ create a map chart\r\n          var map = anychart.map();\r\n          \/\/ set the global map geodata\r\n          map.geoData(\"anychart.maps.world\");\r\n          \/\/ add zoom ui controls\r\n          var zoomController = anychart.ui.zoom();\r\n          zoomController.render(map);\r\n          \/\/ set the land area color\r\n          map.unboundRegions()\r\n            .enabled(true)\r\n            .fill('#E1E1E1')\r\n            .stroke('#D2D2D2');\r\n          \/\/ set the background color\r\n          map.background()\r\n            .fill({\r\n              color: '#daedea', \r\n              opacity: 0.5  \r\n            });\r\n          \/\/ create a dataset from data\r\n          var citiesDataSet = anychart.data.set(data).mapAs();\r\n          \/\/ helper function to create several series\r\n          var createSeries = function (name, data, color) {\r\n            \/\/ set the marker series\r\n            var series = map.marker(data);\r\n            \/\/ configure the series settings\r\n            series\r\n              .name(name)\r\n              .type(\"circle\")\r\n              .fill(color)\r\n              .stroke(anychart.color.darken(color, 0.4))\r\n              .labels(false);\r\n            \/\/ configure the series legend items\r\n            series\r\n              .legendItem()\r\n              .iconType(\"circle\")\r\n              .iconFill(color)\r\n              .iconStroke(anychart.color.darken(color, 0.4))\r\n          };\r\n          \/\/ create 5 series, filtering the data by number of millionaires\r\n          createSeries(\r\n            \"Over 100,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(100000, 1000000)),\r\n            \"#D1FAE9\"\r\n          );\r\n          createSeries(\r\n            \"50,000\u2013100,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(50000, 100000)),\r\n            \"#9CE0E5\"\r\n          );\r\n          createSeries(\r\n            \"10,000\u201350,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(10000, 50000)),\r\n            \"#00ACC3\"\r\n          );\r\n          createSeries(\r\n            \"1,000\u201310,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(1000, 10000)),\r\n            \"#355CB1\"\r\n          );\r\n          createSeries(\r\n            \"Up to 1,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(0, 1000)),\r\n            \"#002D79\"\r\n          );\r\n          \/\/ add a legend\r\n          map.legend(true);\r\n          \/\/ configure the map tooltip\r\n          map.tooltip()\r\n            .useHtml(true)\r\n            .titleFormat(function () {\r\n              return this.getData(\"name\") +\r\n                \" (\" +\r\n                this.getData(\"Country\") +\r\n                \")\";\r\n            })\r\n            .format(function () {\r\n              return (\r\n                \"&lt;span style='color: #bfbfbf'&gt;Millionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Millionaires\") +\r\n                \"&lt;br\/&gt;\" +\r\n                \"&lt;span style='color: #bfbfbf'&gt;Centimillionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Centimillionaires\") +\r\n                \"&lt;br\/&gt;\" +\r\n                \"&lt;span style='color: #bfbfbf'&gt;Billionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Billionaires\")\r\n              );\r\n            });\r\n          \/\/ set a title\r\n          map.title()\r\n            .enabled(true)\r\n            .useHtml(true)\r\n            .text(\r\n              \"Wealthiest Cities&lt;br\/&gt;\" +\r\n              \"&lt;span style='color: #929292; font-size: 12px;'&gt;\" +\r\n              \"Based on the number of millionaires&lt;\/span&gt;\"\r\n            );\r\n          \/\/ specify a container\r\n          map.container(\"container\");\r\n          \/\/ draw the resulting map\r\n          map.draw();\r\n        }\r\n      );\r\n    });\r\n    \/\/ helper filter function\r\n    function filterFunction(val1, val2) {\r\n      if (val2) {\r\n        return function (fieldVal) {\r\n          return val1 &lt;= fieldVal &amp;&amp; fieldVal &lt; val2;\r\n        };\r\n      }\r\n      return function (fieldVal) {\r\n        return val1 &lt;= fieldVal;\r\n      };\r\n    }\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>C. Bonus: Transforming JS Point Map to JS Bubble Map<\/h2>\n<p>As alluded to earlier, I have an exciting bonus for you. I\u2019ll show you how you can swiftly transform your JavaScript point map into a JavaScript bubble map, using the size of the bubbles to visualize the count of billionaires in each city with the same data. Firstly, make changes to the dataset to set the bubble size (below, it\u2019s based on billionaires).<\/p>\n<pre><code class=\"javascript\">var citiesDataSet = anychart.data.set(data).mapAs({size: \"Billionaires\"});<\/code><\/pre>\n<p>Then, change the marker series to bubble.<\/p>\n<pre><code class=\"javascript\">var series = map.bubble(data);<\/code><\/pre>\n<p>Finally, set the maximum and minimum bubble size for a neat visualization, if needed. For instance, like this:<\/p>\n<pre><code class=\"javascript\">map.maxBubbleSize(20);\r\nmap.minBubbleSize(3);<\/code><\/pre>\n<p>There you go! Check out the resulting JavaScript-based bubble map, encoding millionaires in color and billionaires in size. Feel free to refer to the comprehensive code for the completed point map below and explore the interactive version with (editable) code <a href=\"https:\/\/playground.anychart.com\/f5vzlJZL\" target=\"_blank\" rel=\"nofollow\">here<\/a>.<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-f5vzlJZL\" src=\"https:\/\/playground.anychart.com\/f5vzlJZL\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-f5vzlJZL{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\"&gt;\r\n  &lt;title&gt;JavaScript Point Map&lt;\/title&gt;\r\n  &lt;style type=\"text\/css\"&gt;\r\n    html,\r\n    body,\r\n    #container {\r\n      width: 100%;\r\n      height: 100%;\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n  &lt;\/style&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-map.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/geodata\/custom\/world\/world.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/proj4js\/2.3.15\/proj4.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-data-adapter.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/js\/anychart-ui.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/css\/anychart-ui.min.css\"\/&gt;\r\n  &lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.anychart.com\/releases\/8.12.0\/fonts\/css\/anychart-font.min.css\"\/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;script&gt;\r\n    anychart.onDocumentReady(function() {\r\n      \/\/ load data from a json file\r\n      anychart.data.loadJsonFile(\"https:\/\/gist.githubusercontent.com\/awanshrestha\/9e91dbd3ac4626446cd84f8be97016ae\/raw\/160d5ab2da59a5264e716dcbe3239ce7ac9104b6\/Wealthiest%2520Cities%25202023.json\",\r\n        function(data) {\r\n          \/\/ create a map chart\r\n          var map = anychart.map();\r\n          \/\/ set the global map geodata\r\n          map.geoData(\"anychart.maps.world\");\r\n          \/\/ add zoom ui controls\r\n          var zoomController = anychart.ui.zoom();\r\n          zoomController.render(map);\r\n          \/\/ set the land area color\r\n          map.unboundRegions()\r\n            .enabled(true)\r\n            .fill('#E1E1E1')\r\n            .stroke('#D2D2D2');\r\n          \/\/ set the background color\r\n          map.background()\r\n            .fill({\r\n              color: '#daedea', \r\n              opacity: 0.5  \r\n            });\r\n          \/\/ create a dataset from data\r\n          var citiesDataSet = anychart.data.set(data).mapAs({size: \"Billionaires\"});\r\n          \/\/ helper function to create several series\r\n          var createSeries = function (name, data, color) {\r\n            \/\/ set the bubble series\r\n            var series = map.bubble(data);\r\n            \/\/ set the max and min bubble sizes\r\n            map.maxBubbleSize(20);\r\n            map.minBubbleSize(3);\r\n            \/\/ configure the series settings\r\n            series\r\n              .name(name)\r\n              .type(\"circle\")\r\n              .fill(color)\r\n              .stroke(anychart.color.darken(color, 0.4))\r\n              .labels(false);\r\n            \/\/ configure the series legend items\r\n            series\r\n              .legendItem()\r\n              .iconType(\"circle\")\r\n              .iconFill(color)\r\n              .iconStroke(anychart.color.darken(color, 0.4))\r\n          };\r\n          \/\/ create 5 series, filtering the data by number of millionaires\r\n          createSeries(\r\n            \"Over 100,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(100000, 1000000)),\r\n            \"#D1FAE9\"\r\n          );\r\n          createSeries(\r\n            \"50,000\u2013100,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(50000, 100000)),\r\n            \"#9CE0E5\"\r\n          );\r\n          createSeries(\r\n            \"10,000\u201350,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(10000, 50000)),\r\n            \"#00ACC3\"\r\n          );\r\n          createSeries(\r\n            \"1,000\u201310,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(1000, 10000)),\r\n            \"#355CB1\"\r\n          );\r\n          createSeries(\r\n            \"Up to 1,000\",\r\n            citiesDataSet.filter(\"Millionaires\", filterFunction(0, 1000)),\r\n            \"#002D79\"\r\n          );\r\n          \/\/ add a legend\r\n          map.legend(true);\r\n          \/\/ configure the map tooltip\r\n          map.tooltip()\r\n            .useHtml(true)\r\n            .titleFormat(function () {\r\n              return this.getData(\"name\") +\r\n                \" (\" +\r\n                this.getData(\"Country\") +\r\n                \")\";\r\n            })\r\n            .format(function () {\r\n              return (\r\n                \"&lt;span style='color: #bfbfbf'&gt;Millionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Millionaires\") +\r\n                \"&lt;br\/&gt;\" +\r\n                \"&lt;span style='color: #bfbfbf'&gt;Centimillionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Centimillionaires\") +\r\n                \"&lt;br\/&gt;\" +\r\n                \"&lt;span style='color: #bfbfbf'&gt;Billionaires: &lt;\/span&gt;\" +\r\n                this.getData(\"Billionaires\")\r\n              );\r\n            });\r\n          \/\/ set a title\r\n          map.title()\r\n            .enabled(true)\r\n            .useHtml(true)\r\n            .text(\r\n              \"Wealthiest Cities&lt;br\/&gt;\" +\r\n              \"&lt;span style='color: #929292; font-size: 12px;'&gt;\" +\r\n              \"Based on the number of millionaires&lt;\/span&gt;\"\r\n            );\r\n          \/\/ specify a container\r\n          map.container(\"container\");\r\n          \/\/ draw the resulting map\r\n          map.draw();\r\n        }\r\n      );\r\n    });\r\n    \/\/ helper filter function\r\n    function filterFunction(val1, val2) {\r\n      if (val2) {\r\n        return function (fieldVal) {\r\n          return val1 &lt;= fieldVal &amp;&amp; fieldVal &lt; val2;\r\n        };\r\n      }\r\n      return function (fieldVal) {\r\n        return val1 &lt;= fieldVal;\r\n      };\r\n    }\r\n  &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Congratulations on completing this exciting journey from raw data to a captivating interactive point (and bubble) map! I trust you found the process as enjoyable as I did guiding you through it.<\/p>\n<p>Now, it&#8217;s your turn to take the reins. Explore the <a href=\"https:\/\/docs.anychart.com\/Maps\/Dot_(Point)_Map\" target=\"_blank\" rel=\"nofollow\">myriad ways<\/a> you can customize and tailor JavaScript point maps to align with your unique data narratives. Should you ever feel puzzled or seek guidance, feel free to reach out. My virtual door is always open to assist you on your web data viz journey.<\/p>\n<p>Prepare to captivate with your point maps. Happy JS mapping!<\/p>\n<hr \/>\n<p><strong><em>Published with the permission of Awan Shrestha. Originally appeared on <a href=\"https:\/\/hackernoon.com\/building-a-point-map-in-javascript\" target=\"_blank\" rel=\"nofollow\">Hacker Noon<\/a> under the title &#8220;Building a Point Map in JavaScript&#8221; on December 20, 2023.<\/p>\n<p>You&#8217;re also welcome to check out the <a href=\"https:\/\/www.anychart.com\/blog\/2021\/04\/20\/js-dot-density-map\/\">Dot Map Tutorial<\/a> originally published on our blog earlier, visualizing shipping ports around the world step by step.<\/p>\n<p>Don&#8217;t miss out on our other <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a> and continue honing your interactive data viz skills.<\/p>\n<p>Wanna contribute a cool guest post? Don&#8217;t hesitate to <a href=\"https:\/\/www.anychart.com\/support\/\">contact us<\/a>.<\/strong><\/em><\/p>\n<hr \/>\n<p><!-- SyntaxHighlighter --><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"><\/script><script>hljs.initHighlightingOnLoad();<\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re a budding developer or data enthusiast eager to explore map creation, you&#8217;re in the right place. In this tutorial, I&#8217;ll guide you through how to easily build an interactive point map using JavaScript. To make things even more interesting, I\u2019ll use data on the number of millionaires in cities as an example. By [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,66,263,23,13,279,4],"tags":[],"class_list":["post-17064","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-anymap","category-big-data","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Point Maps in JavaScript: What Is and How to Build a Point (Dot) Map<\/title>\n<meta name=\"description\" content=\"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Point Map in JavaScript\" \/>\n<meta property=\"og:description\" content=\"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\" \/>\n<meta property=\"og:site_name\" content=\"AnyChart News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AnyCharts\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-22T09:44:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-22T11:41:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-social.png\" \/>\n<meta name=\"author\" content=\"Awan Shrestha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create a Point Map in JavaScript\" \/>\n<meta name=\"twitter:description\" content=\"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-social.png\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Awan Shrestha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\"},\"author\":{\"name\":\"Awan Shrestha\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1\"},\"headline\":\"How to Build Point Map with JavaScript\",\"datePublished\":\"2023-12-22T09:44:20+00:00\",\"dateModified\":\"2023-12-22T11:41:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\"},\"wordCount\":1905,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png\",\"articleSection\":[\"AnyChart Charting Component\",\"AnyMap\",\"Big Data\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\",\"name\":\"Point Maps in JavaScript: What Is and How to Build a Point (Dot) Map\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png\",\"datePublished\":\"2023-12-22T09:44:20+00:00\",\"dateModified\":\"2023-12-22T11:41:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1\"},\"description\":\"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png\",\"width\":1366,\"height\":768},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build Point Map with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1\",\"name\":\"Awan Shrestha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g\",\"caption\":\"Awan Shrestha\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/awan-shrestha\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Point Maps in JavaScript: What Is and How to Build a Point (Dot) Map","description":"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Point Map in JavaScript","og_description":"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!","og_url":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2023-12-22T09:44:20+00:00","article_modified_time":"2023-12-22T11:41:11+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-social.png","type":"","width":"","height":""}],"author":"Awan Shrestha","twitter_card":"summary_large_image","twitter_title":"How to Create a Point Map in JavaScript","twitter_description":"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map-social.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Awan Shrestha","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/"},"author":{"name":"Awan Shrestha","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1"},"headline":"How to Build Point Map with JavaScript","datePublished":"2023-12-22T09:44:20+00:00","dateModified":"2023-12-22T11:41:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/"},"wordCount":1905,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png","articleSection":["AnyChart Charting Component","AnyMap","Big Data","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/","url":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/","name":"Point Maps in JavaScript: What Is and How to Build a Point (Dot) Map","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png","datePublished":"2023-12-22T09:44:20+00:00","dateModified":"2023-12-22T11:41:11+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1"},"description":"Master creating interactive point maps in JavaScript! Step-by-step guide using millionaire counts for global cities for illustration. Dive in now!","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2023\/12\/point-map.png","width":1366,"height":768},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2023\/12\/22\/point-map-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Build Point Map with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/3f107fdcb3fe326a63cd52812f5287c1","name":"Awan Shrestha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/02ebd18c927547ca82372246dddcc3aebfa98928cb91405eef1a63ece7f17518?s=96&r=g","caption":"Awan Shrestha"},"url":"https:\/\/www.anychart.com\/blog\/author\/awan-shrestha\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=17064"}],"version-history":[{"count":8,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17064\/revisions"}],"predecessor-version":[{"id":17074,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17064\/revisions\/17074"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=17064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=17064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=17064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}