svgmap
Version:
svgMap is a JavaScript library that lets you easily create an interactable world map comparing customizable data for each country.
1 lines • 216 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../src/js/core/svg-map.js"],"sourcesContent":["export default class svgMap {\n constructor(options = {}) {\n const defaultOptions = {\n // The element to render the map in\n targetElementID: '',\n\n // Allow user to zoom and pan\n allowInteraction: true,\n\n // Minimum and maximum zoom\n minZoom: 1,\n maxZoom: 25,\n\n // Initial zoom\n initialZoom: 1.06,\n\n // Initial pan\n initialPan: {\n x: 0,\n y: 0\n },\n\n // Zoom sensitivity\n zoomScaleSensitivity: 0.2,\n\n // Zoom with double-click\n dblClickZoomEnabled: true,\n\n // Zoom with mousewheel\n mouseWheelZoomEnabled: true,\n\n // Allow zooming only when one of the following keys is pressed: 'shift', 'control', 'alt' (Windows), 'command' (MacOS), 'option' (MacOS)\n mouseWheelZoomWithKey: false,\n\n // The message to show for non MacOS systems\n mouseWheelKeyMessage: 'Press the [ALT] key to zoom',\n\n // The message to show for MacOS\n mouseWheelKeyMessageMac: 'Press the [COMMAND] key to zoom',\n\n // Position of the zoom buttons\n zoomButtonsPosition: 'bottomLeft',\n\n // Data colors\n colorMax: '#CC0033',\n colorMin: '#FFE5D9',\n colorNoData: '#E2E2E2',\n\n // Ratio type for the color scale, can be 'linear' or 'log' for logarithmic or a custom function (value, min, max) => ratio\n ratioType: 'linear',\n\n // The flag type can be 'image' or 'emoji'\n flagType: 'image',\n\n // The URL to the flags when using flag type 'image', {0} will get replaced with the lowercase country id\n flagURL:\n 'https://cdn.jsdelivr.net/gh/hjnilsson/country-flags@latest/svg/{0}.svg',\n\n // Decide whether to show the flag option or not\n hideFlag: false,\n\n // Whether attributes with no data should be displayed\n hideMissingData: false,\n\n // The default text to be shown when no data is present\n noDataText: 'No data available',\n\n // Set to true to open the link on mobile devices, set to false (default) to show the tooltip\n touchLink: false,\n\n // Set to true to show the to show a zoom reset button\n showZoomReset: false,\n\n // Called when a tooltip is created to custimize the tooltip content\n onGetTooltip: function (tooltipDiv, countryID, countryValues) {\n return null;\n },\n\n // Country specific options\n countries: {\n // Western Sahara: Set to false to combine Morocco (MA) and Western Sahara (EH)\n EH: true\n },\n\n // Set to true to show a drop down menu with the continents\n showContinentSelector: false,\n\n // Reset zoom on resize\n resetZoomOnResize: false\n };\n\n this.options = Object.assign({}, defaultOptions, options);\n\n this.init();\n }\n\n // Initialize\n init() {\n // Abort if target element not found\n if (\n !this.options.targetElementID ||\n !document.getElementById(this.options.targetElementID)\n ) {\n this.error('Target element not found');\n }\n\n // Abort if no data\n if (!this.options.data) {\n this.error('No data');\n }\n\n // Global id\n this.id = this.options.targetElementID;\n\n // Wrapper element\n this.wrapper = document.getElementById(this.options.targetElementID);\n this.wrapper.classList.add('svgMap-wrapper');\n\n // Container element\n this.container = document.createElement('div');\n this.container.classList.add('svgMap-container');\n this.wrapper.appendChild(this.container);\n\n // Block scrolling when option is enabled\n if (\n this.options.allowInteraction &&\n this.options.mouseWheelZoomEnabled &&\n this.options.mouseWheelZoomWithKey\n ) {\n this.addMouseWheelZoomNotice();\n this.addMouseWheelZoomWithKeyEvents();\n }\n\n // Map container element\n this.mapContainer = document.createElement('div');\n this.mapContainer.classList.add('svgMap-map-container');\n this.container.appendChild(this.mapContainer);\n\n // Create the map\n this.createMap();\n\n // Apply map data\n this.applyData(this.options.data);\n }\n\n // Countries\n\n countries = {\n AF: 'Afghanistan',\n AX: 'Åland Islands',\n AL: 'Albania',\n DZ: 'Algeria',\n AS: 'American Samoa',\n AD: 'Andorra',\n AO: 'Angola',\n AI: 'Anguilla',\n AQ: 'Antarctica',\n AG: 'Antigua and Barbuda',\n AR: 'Argentina',\n AM: 'Armenia',\n AW: 'Aruba',\n AU: 'Australia',\n AT: 'Austria',\n AZ: 'Azerbaijan',\n BS: 'Bahamas',\n BH: 'Bahrain',\n BD: 'Bangladesh',\n BB: 'Barbados',\n BY: 'Belarus',\n BE: 'Belgium',\n BZ: 'Belize',\n BJ: 'Benin',\n BM: 'Bermuda',\n BT: 'Bhutan',\n BO: 'Bolivia',\n BA: 'Bosnia and Herzegovina',\n BW: 'Botswana',\n BR: 'Brazil',\n IO: 'British Indian Ocean Territory',\n VG: 'British Virgin Islands',\n BN: 'Brunei Darussalam',\n BG: 'Bulgaria',\n BF: 'Burkina Faso',\n BI: 'Burundi',\n KH: 'Cambodia',\n CM: 'Cameroon',\n CA: 'Canada',\n CV: 'Cape Verde',\n BQ: 'Caribbean Netherlands',\n KY: 'Cayman Islands',\n CF: 'Central African Republic',\n TD: 'Chad',\n CL: 'Chile',\n CN: 'China',\n CX: 'Christmas Island',\n CC: 'Cocos Islands',\n CO: 'Colombia',\n KM: 'Comoros',\n CG: 'Congo',\n CK: 'Cook Islands',\n CR: 'Costa Rica',\n HR: 'Croatia',\n CU: 'Cuba',\n CW: 'Curaçao',\n CY: 'Cyprus',\n CZ: 'Czech Republic',\n CD: 'Democratic Republic of the Congo',\n DK: 'Denmark',\n DJ: 'Djibouti',\n DM: 'Dominica',\n DO: 'Dominican Republic',\n EC: 'Ecuador',\n EG: 'Egypt',\n SV: 'El Salvador',\n GQ: 'Equatorial Guinea',\n ER: 'Eritrea',\n EE: 'Estonia',\n ET: 'Ethiopia',\n FK: 'Falkland Islands',\n FO: 'Faroe Islands',\n FM: 'Federated States of Micronesia',\n FJ: 'Fiji',\n FI: 'Finland',\n FR: 'France',\n GF: 'French Guiana',\n PF: 'French Polynesia',\n TF: 'French Southern Territories',\n GA: 'Gabon',\n GM: 'Gambia',\n GE: 'Georgia',\n DE: 'Germany',\n GH: 'Ghana',\n GI: 'Gibraltar',\n GR: 'Greece',\n GL: 'Greenland',\n GD: 'Grenada',\n GP: 'Guadeloupe',\n GU: 'Guam',\n GT: 'Guatemala',\n GN: 'Guinea',\n GW: 'Guinea-Bissau',\n GY: 'Guyana',\n HT: 'Haiti',\n HN: 'Honduras',\n HK: 'Hong Kong',\n HU: 'Hungary',\n IS: 'Iceland',\n IN: 'India',\n ID: 'Indonesia',\n IR: 'Iran',\n IQ: 'Iraq',\n IE: 'Ireland',\n IM: 'Isle of Man',\n IL: 'Israel',\n IT: 'Italy',\n CI: 'Ivory Coast',\n JM: 'Jamaica',\n JP: 'Japan',\n JE: 'Jersey',\n JO: 'Jordan',\n KZ: 'Kazakhstan',\n KE: 'Kenya',\n KI: 'Kiribati',\n XK: 'Kosovo',\n KW: 'Kuwait',\n KG: 'Kyrgyzstan',\n LA: 'Laos',\n LV: 'Latvia',\n LB: 'Lebanon',\n LS: 'Lesotho',\n LR: 'Liberia',\n LY: 'Libya',\n LI: 'Liechtenstein',\n LT: 'Lithuania',\n LU: 'Luxembourg',\n MO: 'Macau',\n MK: 'Macedonia',\n MG: 'Madagascar',\n MW: 'Malawi',\n MY: 'Malaysia',\n MV: 'Maldives',\n ML: 'Mali',\n MT: 'Malta',\n MH: 'Marshall Islands',\n MQ: 'Martinique',\n MR: 'Mauritania',\n MU: 'Mauritius',\n YT: 'Mayotte',\n MX: 'Mexico',\n MD: 'Moldova',\n MC: 'Monaco',\n MN: 'Mongolia',\n ME: 'Montenegro',\n MS: 'Montserrat',\n MA: 'Morocco',\n MZ: 'Mozambique',\n MM: 'Myanmar',\n NA: 'Namibia',\n NR: 'Nauru',\n NP: 'Nepal',\n NL: 'Netherlands',\n NC: 'New Caledonia',\n NZ: 'New Zealand',\n NI: 'Nicaragua',\n NE: 'Niger',\n NG: 'Nigeria',\n NU: 'Niue',\n NF: 'Norfolk Island',\n KP: 'North Korea',\n MP: 'Northern Mariana Islands',\n NO: 'Norway',\n OM: 'Oman',\n PK: 'Pakistan',\n PW: 'Palau',\n PS: 'Palestine',\n PA: 'Panama',\n PG: 'Papua New Guinea',\n PY: 'Paraguay',\n PE: 'Peru',\n PH: 'Philippines',\n PN: 'Pitcairn Islands',\n PL: 'Poland',\n PT: 'Portugal',\n PR: 'Puerto Rico',\n QA: 'Qatar',\n RE: 'Reunion',\n RO: 'Romania',\n RU: 'Russia',\n RW: 'Rwanda',\n SH: 'Saint Helena',\n KN: 'Saint Kitts and Nevis',\n LC: 'Saint Lucia',\n PM: 'Saint Pierre and Miquelon',\n VC: 'Saint Vincent and the Grenadines',\n WS: 'Samoa',\n SM: 'San Marino',\n ST: 'São Tomé and Príncipe',\n SA: 'Saudi Arabia',\n SN: 'Senegal',\n RS: 'Serbia',\n SC: 'Seychelles',\n SL: 'Sierra Leone',\n SG: 'Singapore',\n SX: 'Sint Maarten',\n SK: 'Slovakia',\n SI: 'Slovenia',\n SB: 'Solomon Islands',\n SO: 'Somalia',\n ZA: 'South Africa',\n GS: 'South Georgia and the South Sandwich Islands',\n KR: 'South Korea',\n SS: 'South Sudan',\n ES: 'Spain',\n LK: 'Sri Lanka',\n SD: 'Sudan',\n SR: 'Suriname',\n SJ: 'Svalbard and Jan Mayen',\n SZ: 'Eswatini',\n SE: 'Sweden',\n CH: 'Switzerland',\n SY: 'Syria',\n TW: 'Taiwan',\n TJ: 'Tajikistan',\n TZ: 'Tanzania',\n TH: 'Thailand',\n TL: 'Timor-Leste',\n TG: 'Togo',\n TK: 'Tokelau',\n TO: 'Tonga',\n TT: 'Trinidad and Tobago',\n TN: 'Tunisia',\n TR: 'Turkey',\n TM: 'Turkmenistan',\n TC: 'Turks and Caicos Islands',\n TV: 'Tuvalu',\n UG: 'Uganda',\n UA: 'Ukraine',\n AE: 'United Arab Emirates',\n GB: 'United Kingdom',\n US: 'United States',\n UM: 'United States Minor Outlying Islands',\n VI: 'United States Virgin Islands',\n UY: 'Uruguay',\n UZ: 'Uzbekistan',\n VU: 'Vanuatu',\n VA: 'Vatican City',\n VE: 'Venezuela',\n VN: 'Vietnam',\n WF: 'Wallis and Futuna',\n EH: 'Western Sahara',\n YE: 'Yemen',\n ZM: 'Zambia',\n ZW: 'Zimbabwe'\n };\n\n // Apply the data to the map\n\n applyData(data) {\n var max = null;\n var min = null;\n\n // Get highest and lowest value\n Object.keys(data.values).forEach(function (countryID) {\n var value = parseInt(data.values[countryID][data.applyData], 10);\n max === null && (max = value);\n min === null && (min = value);\n value > max && (max = value);\n value < min && (min = value);\n });\n\n data.data[data.applyData].thresholdMax &&\n (max = Math.min(max, data.data[data.applyData].thresholdMax));\n data.data[data.applyData].thresholdMin &&\n (min = Math.max(min, data.data[data.applyData].thresholdMin));\n\n // Loop through countries and set colors\n Object.keys(this.countries).forEach(\n function (countryID) {\n var element = document.getElementById(\n this.id + '-map-country-' + countryID\n );\n if (!element) {\n return;\n }\n if (!data.values[countryID]) {\n element.style.setProperty(\n '--svg-map-country-fill',\n this.toHex(this.options.colorNoData)\n );\n return;\n }\n if (typeof data.values[countryID].color != 'undefined') {\n element.style.setProperty(\n '--svg-map-country-fill',\n data.values[countryID].color\n );\n return;\n }\n var value = Math.max(\n min,\n parseInt(data.values[countryID][data.applyData], 10)\n );\n\n var color = this.getColor(\n this.toHex(this.options.colorMax),\n this.toHex(this.options.colorMin),\n this.calculateColorRatio(value, min, max, this.options.ratioType)\n );\n element.style.setProperty('--svg-map-country-fill', color);\n }.bind(this)\n );\n }\n\n calculateColorRatio(value, min, max, ratioType) {\n var range = max - min;\n var positionInRange = value - min;\n\n if (range === 0 || positionInRange === 0) {\n return 0;\n }\n\n if (ratioType === 'log') {\n var logValue = Math.log(positionInRange + 1);\n var logMin = Math.log(1);\n var logMax = Math.log(range + 1);\n var ratio = Math.max(\n 0,\n Math.min(1, (logValue - logMin) / (logMax - logMin))\n );\n return ratio || ratio === 0 ? ratio : 1;\n }\n\n if (ratioType === 'linear') {\n var ratio = Math.max(0, Math.min(1, positionInRange / range));\n return ratio || ratio === 0 ? ratio : 1;\n }\n\n if (typeof ratioType === 'function') {\n return ratioType(value, min, max);\n }\n\n return 1;\n }\n\n // Emoji flags\n\n emojiFlags = {\n AF: '🇦🇫',\n AX: '🇦🇽',\n AL: '🇦🇱',\n DZ: '🇩🇿',\n AS: '🇦🇸',\n AD: '🇦🇩',\n AO: '🇦🇴',\n AI: '🇦🇮',\n AQ: '🇦🇶',\n AG: '🇦🇬',\n AR: '🇦🇷',\n AM: '🇦🇲',\n AW: '🇦🇼',\n AU: '🇦🇺',\n AT: '🇦🇹',\n AZ: '🇦🇿',\n BS: '🇧🇸',\n BH: '🇧🇭',\n BD: '🇧🇩',\n BB: '🇧🇧',\n BY: '🇧🇾',\n BE: '🇧🇪',\n BZ: '🇧🇿',\n BJ: '🇧🇯',\n BM: '🇧🇲',\n BT: '🇧🇹',\n BO: '🇧🇴',\n BA: '🇧🇦',\n BW: '🇧🇼',\n BR: '🇧🇷',\n IO: '🇮🇴',\n VG: '🇻🇬',\n BN: '🇧🇳',\n BG: '🇧🇬',\n BF: '🇧🇫',\n BI: '🇧🇮',\n KH: '🇰🇭',\n CM: '🇨🇲',\n CA: '🇨🇦',\n CV: '🇨🇻',\n BQ: '🇧🇶',\n KY: '🇰🇾',\n CF: '🇨🇫',\n TD: '🇹🇩',\n CL: '🇨🇱',\n CN: '🇨🇳',\n CX: '🇨🇽',\n CC: '🇨🇨',\n CO: '🇨🇴',\n KM: '🇰🇲',\n CG: '🇨🇬',\n CK: '🇨🇰',\n CR: '🇨🇷',\n HR: '🇭🇷',\n CU: '🇨🇺',\n CW: '🇨🇼',\n CY: '🇨🇾',\n CZ: '🇨🇿',\n CD: '🇨🇩',\n DK: '🇩🇰',\n DJ: '🇩🇯',\n DM: '🇩🇲',\n DO: '🇩🇴',\n EC: '🇪🇨',\n EG: '🇪🇬',\n SV: '🇸🇻',\n GQ: '🇬🇶',\n ER: '🇪🇷',\n EE: '🇪🇪',\n ET: '🇪🇹',\n FK: '🇫🇰',\n FO: '🇫🇴',\n FM: '🇫🇲',\n FJ: '🇫🇯',\n FI: '🇫🇮',\n FR: '🇫🇷',\n GF: '🇬🇫',\n PF: '🇵🇫',\n TF: '🇹🇫',\n GA: '🇬🇦',\n GM: '🇬🇲',\n GE: '🇬🇪',\n DE: '🇩🇪',\n GH: '🇬🇭',\n GI: '🇬🇮',\n GR: '🇬🇷',\n GL: '🇬🇱',\n GD: '🇬🇩',\n GP: '🇬🇵',\n GU: '🇬🇺',\n GT: '🇬🇹',\n GN: '🇬🇳',\n GW: '🇬🇼',\n GY: '🇬🇾',\n HT: '🇭🇹',\n HN: '🇭🇳',\n HK: '🇭🇰',\n HU: '🇭🇺',\n IS: '🇮🇸',\n IN: '🇮🇳',\n ID: '🇮🇩',\n IR: '🇮🇷',\n IQ: '🇮🇶',\n IE: '🇮🇪',\n IM: '🇮🇲',\n IL: '🇮🇱',\n IT: '🇮🇹',\n CI: '🇨🇮',\n JM: '🇯🇲',\n JP: '🇯🇵',\n JE: '🇯🇪',\n JO: '🇯🇴',\n KZ: '🇰🇿',\n KE: '🇰🇪',\n KI: '🇰🇮',\n XK: '🇽🇰',\n KW: '🇰🇼',\n KG: '🇰🇬',\n LA: '🇱🇦',\n LV: '🇱🇻',\n LB: '🇱🇧',\n LS: '🇱🇸',\n LR: '🇱🇷',\n LY: '🇱🇾',\n LI: '🇱🇮',\n LT: '🇱🇹',\n LU: '🇱🇺',\n MO: '🇲🇴',\n MK: '🇲🇰',\n MG: '🇲🇬',\n MW: '🇲🇼',\n MY: '🇲🇾',\n MV: '🇲🇻',\n ML: '🇲🇱',\n MT: '🇲🇹',\n MH: '🇲🇭',\n MQ: '🇲🇶',\n MR: '🇲🇷',\n MU: '🇲🇺',\n YT: '🇾🇹',\n MX: '🇲🇽',\n MD: '🇲🇩',\n MC: '🇲🇨',\n MN: '🇲🇳',\n ME: '🇲🇪',\n MS: '🇲🇸',\n MA: '🇲🇦',\n MZ: '🇲🇿',\n MM: '🇲🇲',\n NA: '🇳🇦',\n NR: '🇳🇷',\n NP: '🇳🇵',\n NL: '🇳🇱',\n NC: '🇳🇨',\n NZ: '🇳🇿',\n NI: '🇳🇮',\n NE: '🇳🇪',\n NG: '🇳🇬',\n NU: '🇳🇺',\n NF: '🇳🇫',\n KP: '🇰🇵',\n MP: '🇲🇵',\n NO: '🇳🇴',\n OM: '🇴🇲',\n PK: '🇵🇰',\n PW: '🇵🇼',\n PS: '🇵🇸',\n PA: '🇵🇦',\n PG: '🇵🇬',\n PY: '🇵🇾',\n PE: '🇵🇪',\n PH: '🇵🇭',\n PN: '🇵🇳',\n PL: '🇵🇱',\n PT: '🇵🇹',\n PR: '🇵🇷',\n QA: '🇶🇦',\n RE: '🇷🇪',\n RO: '🇷🇴',\n RU: '🇷🇺',\n RW: '🇷🇼',\n SH: '🇸🇭',\n KN: '🇰🇳',\n LC: '🇱🇨',\n PM: '🇵🇲',\n VC: '🇻🇨',\n WS: '🇼🇸',\n SM: '🇸🇲',\n ST: '🇸🇹',\n SA: '🇸🇦',\n SN: '🇸🇳',\n RS: '🇷🇸',\n SC: '🇸🇨',\n SL: '🇸🇱',\n SG: '🇸🇬',\n SX: '🇸🇽',\n SK: '🇸🇰',\n SI: '🇸🇮',\n SB: '🇸🇧',\n SO: '🇸🇴',\n ZA: '🇿🇦',\n GS: '🇬🇸',\n KR: '🇰🇷',\n SS: '🇸🇸',\n ES: '🇪🇸',\n LK: '🇱🇰',\n SD: '🇸🇩',\n SR: '🇸🇷',\n SJ: '🇸🇯',\n SZ: '🇸🇿',\n SE: '🇸🇪',\n CH: '🇨🇭',\n SY: '🇸🇾',\n TW: '🇹🇼',\n TJ: '🇹🇯',\n TZ: '🇹🇿',\n TH: '🇹🇭',\n TL: '🇹🇱',\n TG: '🇹🇬',\n TK: '🇹🇰',\n TO: '🇹🇴',\n TT: '🇹🇹',\n TN: '🇹🇳',\n TR: '🇹🇷',\n TM: '🇹🇲',\n TC: '🇹🇨',\n TV: '🇹🇻',\n UG: '🇺🇬',\n UA: '🇺🇦',\n AE: '🇦🇪',\n GB: '🇬🇧',\n US: '🇺🇸',\n UM: '🇺🇲',\n VI: '🇻🇮',\n UY: '🇺🇾',\n UZ: '🇺🇿',\n VU: '🇻🇺',\n VA: '🇻🇦',\n VE: '🇻🇪',\n VN: '🇻🇳',\n WF: '🇼🇫',\n EH: '🇪🇭',\n YE: '🇾🇪',\n ZM: '🇿🇲',\n ZW: '🇿🇼'\n };\n\n continents = {\n EA: {\n iso: 'EA',\n name: 'World'\n },\n AF: {\n iso: 'AF',\n name: 'Africa',\n pan: {\n x: 454,\n y: 250\n },\n zoom: 1.9\n },\n AS: {\n iso: 'AS',\n name: 'Asia',\n pan: {\n x: 904,\n y: 80\n },\n zoom: 1.8\n },\n EU: {\n iso: 'EU',\n name: 'Europe',\n pan: {\n x: 404,\n y: 80\n },\n zoom: 5\n },\n NA: {\n iso: 'NA',\n name: 'North America',\n pan: {\n x: 104,\n y: 55\n },\n zoom: 2.6\n },\n\n MA: {\n iso: 'MA',\n name: 'Middle America',\n pan: {\n x: 104,\n y: 200\n },\n zoom: 2.6\n },\n SA: {\n iso: 'SA',\n name: 'South America',\n pan: {\n x: 104,\n y: 340\n },\n zoom: 2.2\n },\n OC: {\n iso: 'OC',\n name: 'Oceania',\n pan: {\n x: 954,\n y: 350\n },\n zoom: 1.9\n }\n };\n // Create the SVG map\n\n createMap() {\n // Create the tooltip\n this.createTooltip();\n\n // Create map wrappers\n this.mapWrapper = this.createElement(\n 'div',\n 'svgMap-map-wrapper',\n this.mapContainer\n );\n this.mapImage = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg'\n );\n this.mapImage.setAttribute('viewBox', '0 0 2000 1001');\n this.mapImage.classList.add('svgMap-map-image');\n this.mapWrapper.appendChild(this.mapImage);\n\n // Add controls\n var mapControlsWrapper = this.createElement(\n 'div',\n 'svgMap-map-controls-wrapper',\n this.mapWrapper\n );\n mapControlsWrapper.classList.add(\n 'svgMap-controls-position-' + this.options.zoomButtonsPosition\n );\n var zoomContainer = this.createElement(\n 'div',\n 'svgMap-map-controls-zoom',\n mapControlsWrapper\n );\n ['in', 'out', 'reset'].forEach(\n function (item) {\n if (\n (item === 'reset' && this.options.showZoomReset) ||\n item !== 'reset'\n ) {\n var zoomControlName =\n 'zoomControl' + item.charAt(0).toUpperCase() + item.slice(1);\n this[zoomControlName] = this.createElement(\n 'button',\n 'svgMap-control-button svgMap-zoom-button svgMap-zoom-' +\n item +\n '-button',\n zoomContainer\n );\n this[zoomControlName].type = 'button';\n this[zoomControlName].addEventListener(\n 'click',\n function () {\n if (this.options.allowInteraction) {\n this.zoomMap(item);\n }\n }.bind(this),\n { passive: true }\n );\n }\n }.bind(this)\n );\n\n if (!this.options.allowInteraction) {\n mapControlsWrapper.classList.add('svgMap-disabled');\n mapControlsWrapper.setAttribute('aria-disabled', 'true');\n }\n\n // Add accessible names to zoom controls\n this.zoomControlIn.setAttribute('aria-label', 'Zoom in');\n this.zoomControlOut.setAttribute('aria-label', 'Zoom out');\n\n if (this.options.allowInteraction && this.options.showContinentSelector) {\n // Add continent controls\n var mapContinentControlsWrapper = this.createElement(\n 'div',\n 'svgMap-map-continent-controls-wrapper',\n this.mapWrapper\n );\n this['continentSelect'] = this.createElement(\n 'select',\n 'svgMap-continent-select',\n mapContinentControlsWrapper\n );\n var that = this;\n\n Object.keys(this.continents).forEach(function (item) {\n let element = that.createElement(\n 'option',\n 'svgMap-continent-option svgMap-continent-iso-' +\n that.continents[item].iso,\n that['continentSelect'],\n that.continents[item].name\n );\n element.value = item;\n });\n\n this.continentSelect.addEventListener(\n 'change',\n function (e) {\n const continent = e.target.value;\n if (continent) this.zoomContinent(e.target.value);\n }.bind(that),\n { passive: true }\n );\n mapContinentControlsWrapper.setAttribute(\n 'aria-label',\n 'Select continent'\n );\n }\n // Fix countries\n var mapPaths = Object.assign({}, this.mapPaths);\n\n if (!this.options.countries.EH) {\n mapPaths.MA.d = mapPaths['MA-EH'].d;\n delete mapPaths.EH;\n }\n delete mapPaths['MA-EH'];\n\n // Expose tooltipMove function\n\n this.tooltipMoveEvent = function (e) {\n this.moveTooltip(e);\n }.bind(this);\n\n // Add map elements\n Object.keys(mapPaths).forEach(\n function (countryID) {\n var countryData = this.mapPaths[countryID];\n if (!countryData.d) {\n return;\n }\n\n var countryElement = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'path'\n );\n\n countryElement.setAttribute('d', countryData.d);\n countryElement.setAttribute(\n 'id',\n this.id + '-map-country-' + countryID\n );\n countryElement.setAttribute('data-id', countryID);\n countryElement.classList.add('svgMap-country');\n\n this.mapImage.appendChild(countryElement);\n\n // Tooltip events\n // Add tooltip when touch is used\n countryElement.addEventListener(\n 'touchstart',\n function (e) {\n var activeCountries = document.querySelectorAll('.svgMap-active');\n activeCountries.forEach(function (element) {\n element.classList.remove('svgMap-active');\n });\n countryElement.parentNode.appendChild(countryElement);\n countryElement.classList.add('svgMap-active');\n\n var countryID = countryElement.getAttribute('data-id');\n var countryLink = countryElement.getAttribute('data-link');\n if (this.options.touchLink) {\n if (countryLink) {\n window.location.href = countryLink;\n return;\n }\n }\n this.setTooltipContent(this.getTooltipContent(countryID));\n this.showTooltip(e);\n this.moveTooltip(e);\n\n countryElement.addEventListener(\n 'touchmove',\n this.tooltipMoveEvent,\n {\n passive: true\n }\n );\n }.bind(this),\n { passive: true }\n );\n\n countryElement.addEventListener(\n 'mouseenter',\n function (e) {\n countryElement.parentNode.appendChild(countryElement);\n countryElement.classList.add('svgMap-active');\n var countryID = countryElement.getAttribute('data-id');\n this.setTooltipContent(this.getTooltipContent(countryID));\n this.showTooltip(e);\n countryElement.addEventListener(\n 'mousemove',\n this.tooltipMoveEvent,\n {\n passive: true\n }\n );\n }.bind(this),\n { passive: true }\n );\n\n if (\n this.options.data.values &&\n this.options.data.values[countryID] &&\n this.options.data.values[countryID]['link']\n ) {\n countryElement.setAttribute(\n 'data-link',\n this.options.data.values[countryID]['link']\n );\n if (this.options.data.values[countryID]['linkTarget']) {\n countryElement.setAttribute(\n 'data-link-target',\n this.options.data.values[countryID]['linkTarget']\n );\n }\n\n let dragged = false;\n countryElement.addEventListener('mousedown', function () {\n dragged = false;\n });\n countryElement.addEventListener('touchstart', function () {\n dragged = false;\n });\n countryElement.addEventListener('mousemove', function () {\n dragged = true;\n });\n countryElement.addEventListener('touchmove', function () {\n dragged = true;\n });\n const clickHandler = function (e) {\n if (dragged) {\n return;\n }\n\n const link = countryElement.getAttribute('data-link');\n const target = countryElement.getAttribute('data-link-target');\n\n if (target) {\n window.open(link, target);\n } else {\n window.location.href = link;\n }\n };\n\n countryElement.addEventListener('click', clickHandler);\n countryElement.addEventListener('touchend', clickHandler);\n }\n\n // Hide tooltip when mouse leaves the country area\n countryElement.addEventListener(\n 'mouseleave',\n function () {\n this.hideTooltip();\n countryElement.classList.remove('svgMap-active');\n countryElement.removeEventListener(\n 'mousemove',\n this.tooltipMoveEvent,\n {\n passive: true\n }\n );\n }.bind(this),\n { passive: true }\n );\n\n // Hide tooltip when touch ends\n countryElement.addEventListener(\n 'touchend',\n function () {\n // Do not hide the tooltip, so it stays open on mobile\n }.bind(this),\n { passive: true }\n );\n\n // Show/hide tooltip on click\n countryElement.addEventListener(\n 'click',\n function (e) {\n e.stopPropagation();\n var countryID = countryElement.getAttribute('data-id');\n if (countryElement.getAttribute('data-tooltip-open') === 'true') {\n this.hideTooltip();\n countryElement.setAttribute('data-tooltip-open', 'false');\n } else {\n this.setTooltipContent(this.getTooltipContent(countryID));\n this.showTooltip(e);\n countryElement.setAttribute('data-tooltip-open', 'true');\n }\n }.bind(this),\n { passive: true }\n );\n }.bind(this)\n );\n\n // Hide tooltip on touch outside\n document.addEventListener(\n 'touchend',\n function (e) {\n if (\n e.target.closest('.svgMap-country') ||\n e.target.closest('.svgMap-tooltip')\n ) {\n return;\n }\n this.hideTooltip();\n var openTooltips = document.querySelectorAll(\n '[data-tooltip-open=\"true\"]'\n );\n openTooltips.forEach(function (element) {\n element.setAttribute('data-tooltip-open', 'false');\n });\n var activeCountries = document.querySelectorAll('.svgMap-active');\n activeCountries.forEach(function (element) {\n element.classList.remove('svgMap-active');\n });\n }.bind(this),\n { passive: true }\n );\n\n // Hide tooltip on click outside\n document.addEventListener(\n 'click',\n function (e) {\n if (\n e.target.closest('.svgMap-country') ||\n e.target.closest('.svgMap-tooltip')\n ) {\n return;\n }\n this.hideTooltip();\n var openTooltips = document.querySelectorAll(\n '[data-tooltip-open=\"true\"]'\n );\n openTooltips.forEach(function (element) {\n element.setAttribute('data-tooltip-open', 'false');\n });\n var activeCountries = document.querySelectorAll('.svgMap-active');\n activeCountries.forEach(function (element) {\n element.classList.remove('svgMap-active');\n });\n }.bind(this),\n { passive: true }\n );\n\n // Expose instance\n var me = this;\n\n // Init pan zoom\n this.mapPanZoom = svgPanZoom(this.mapImage, {\n zoomEnabled: this.options.allowInteraction,\n panEnabled: this.options.allowInteraction,\n fit: true,\n center: true,\n minZoom: this.options.minZoom,\n maxZoom: this.options.maxZoom,\n zoomScaleSensitivity: this.options.zoomScaleSensitivity,\n controlIconsEnabled: false,\n dblClickZoomEnabled: this.options.allowInteraction\n ? this.options.dblClickZoomEnabled\n : false,\n mouseWheelZoomEnabled: this.options.allowInteraction\n ? this.options.mouseWheelZoomEnabled\n : false,\n preventMouseEventsDefault: true,\n onZoom: function () {\n me.setControlStatuses();\n },\n beforePan: function (oldPan, newPan) {\n var gutterWidth = me.mapWrapper.offsetWidth * 0.85;\n var gutterHeight = me.mapWrapper.offsetHeight * 0.85;\n var sizes = this.getSizes();\n var leftLimit =\n -((sizes.viewBox.x + sizes.viewBox.width) * sizes.realZoom) +\n gutterWidth;\n var rightLimit =\n sizes.width - gutterWidth - sizes.viewBox.x * sizes.realZoom;\n var topLimit =\n -((sizes.viewBox.y + sizes.viewBox.height) * sizes.realZoom) +\n gutterHeight;\n var bottomLimit =\n sizes.height - gutterHeight - sizes.viewBox.y * sizes.realZoom;\n return {\n x: Math.max(leftLimit, Math.min(rightLimit, newPan.x)),\n y: Math.max(topLimit, Math.min(bottomLimit, newPan.y))\n };\n }\n });\n\n if (this.options.initialPan.x != 0 || this.options.initialPan.y != 0) {\n // Init zoom and pan\n this.mapPanZoom.zoomAtPointBy(this.options.initialZoom, {\n x: this.options.initialPan.x,\n y: this.options.initialPan.y\n });\n } else {\n // Init zoom\n this.mapPanZoom.zoom(this.options.initialZoom);\n }\n\n // Initial zoom statuses\n this.setControlStatuses();\n\n // Zoom reset on resize\n if (this.options.resetZoomOnResize) {\n const resizeObserver = new ResizeObserver(() => this.mapReset());\n resizeObserver.observe(this.mapWrapper);\n }\n }\n\n // Create the tooltip content\n\n getTooltipContent(countryID) {\n // Custom tooltip\n if (this.options.onGetTooltip) {\n var customDiv = this.options.onGetTooltip(\n this.tooltip,\n countryID,\n this.options.data.values[countryID]\n );\n\n if (customDiv) {\n return customDiv;\n }\n }\n\n var tooltipContentWrapper = this.createElement(\n 'div',\n 'svgMap-tooltip-content-container'\n );\n\n if (this.options.hideFlag === false) {\n // Flag\n var flagContainer = this.createElement(\n 'div',\n 'svgMap-tooltip-flag-container svgMap-tooltip-flag-container-' +\n this.options.flagType,\n tooltipContentWrapper\n );\n\n if (this.options.flagType === 'image') {\n this.createElement(\n 'img',\n 'svgMap-tooltip-flag',\n flagContainer\n ).setAttribute(\n 'src',\n this.options.flagURL.replace('{0}', countryID.toLowerCase())\n );\n } else if (this.options.flagType === 'emoji') {\n flagContainer.innerHTML = this.emojiFlags[countryID];\n }\n }\n\n // Title\n this.createElement(\n 'div',\n 'svgMap-tooltip-title',\n tooltipContentWrapper\n ).innerHTML = this.getCountryName(countryID);\n\n // Content\n var tooltipContent = this.createElement(\n 'div',\n 'svgMap-tooltip-content',\n tooltipContentWrapper\n );\n if (!this.options.data.values[countryID]) {\n this.createElement(\n 'div',\n 'svgMap-tooltip-no-data',\n tooltipContent\n ).innerHTML = this.options.noDataText;\n } else {\n var tooltipContentTable = '<table>';\n Object.keys(this.options.data.data).forEach(\n function (key) {\n var item = this.options.data.data[key];\n var value = this.options.data.values[countryID][key];\n if (\n (value !== undefined && this.options.hideMissingData === true) ||\n this.options.hideMissingData === false\n ) {\n item.floatingNumbers && (value = value.toFixed(1));\n item.thousandSeparator &&\n (value = this.numberWithCommas(value, item.thousandSeparator));\n value = item.format\n ? item.format.replace('{0}', '<span>' + value + '</span>')\n : '<span>' + value + '</span>';\n tooltipContentTable +=\n '<tr><td>' +\n (item.name || '') +\n '</td><td>' +\n value +\n '</td></tr>';\n }\n }.bind(this)\n );\n tooltipContentTable += '</table>';\n tooltipContent.innerHTML = tooltipContentTable;\n }\n return tooltipContentWrapper;\n }\n\n // Set the disabled statuses for buttons\n\n setControlStatuses() {\n this.zoomControlIn.classList.remove('svgMap-disabled');\n this.zoomControlIn.setAttribute('aria-disabled', 'false');\n this.zoomControlOut.classList.remove('svgMap-disabled');\n this.zoomControlOut.setAttribute('aria-disabled', 'false');\n if (this.options.showZoomReset) {\n this.zoomControlReset.classList.remove('svgMap-disabled');\n this.zoomControlReset.setAttribute('aria-disabled', 'false');\n }\n\n if (this.mapPanZoom.getZoom().toFixed(3) <= this.options.minZoom) {\n this.zoomControlOut.classList.add('svgMap-disabled');\n this.zoomControlOut.setAttribute('aria-disabled', 'true');\n }\n if (this.mapPanZoom.getZoom().toFixed(3) >= this.options.maxZoom) {\n this.zoomControlIn.classList.add('svgMap-disabled');\n this.zoomControlIn.setAttribute('aria-disabled', 'true');\n }\n if (\n this.options.showZoomReset &&\n this.mapPanZoom.getZoom().toFixed(3) == this.options.initialZoom\n ) {\n this.zoomControlReset.classList.add('svgMap-disabled');\n this.zoomControlReset.setAttribute('aria-disabled', 'true');\n }\n }\n\n // Zoom map\n\n zoomMap(direction) {\n if (\n this[\n 'zoomControl' + direction.charAt(0).toUpperCase() + direction.slice(1)\n ].classList.contains('svgMap-disabled')\n ) {\n return false;\n }\n if (direction === 'reset') {\n this.mapPanZoom.reset();\n if (this.options.initialPan.x != 0 || this.options.initialPan.y != 0) {\n // Init zoom and pan\n this.mapPanZoom.zoomAtPointBy(this.options.initialZoom, {\n x: this.options.initialPan.x,\n y: this.options.initialPan.y\n });\n } else {\n // Init zoom\n this.mapPanZoom.zoom(this.options.initialZoom);\n }\n } else {\n this.mapPanZoom[direction == 'in' ? 'zoomIn' : 'zoomOut']();\n }\n }\n\n // Zoom reset\n mapReset() {\n this.mapPanZoom.resize();\n this.zoomMap('reset');\n }\n\n // Zoom to Contient\n\n zoomContinent(contientIso) {\n const continent = this.continents[contientIso];\n if (continent.iso == 'EA') this.mapPanZoom.reset();\n else if (continent.pan) {\n this.mapPanZoom.reset();\n this.mapPanZoom.zoomAtPoint(continent.zoom, continent.pan);\n }\n }\n\n // Add elements to show the zoom with keys notice\n\n addMouseWheelZoomNotice() {\n var noticeWrapper = document.createElement('div');\n noticeWrapper.classList.add('svgMap-block-zoom-notice');\n\n var noticeContainer = document.createElement('div');\n noticeContainer.innerHTML =\n navigator.appVersion.indexOf('Mac') != -1\n ? this.options.mouseWheelKeyMessageMac\n : this.options.mouseWheelKeyMessage;\n\n noticeWrapper.append(noticeContainer);\n this.wrapper.append(noticeWrapper);\n }\n\n // Show the zoom with keys notice\n\n showMouseWheelZoomNotice(duration) {\n if (this.mouseWheelNoticeJustHidden) {\n return;\n }\n\n this.autoHideMouseWheelNoticeTimeout &&\n clearTimeout(this.autoHideMouseWheelNoticeTimeout);\n this.autoHideMouseWheelNoticeTimeout = setTimeout(\n function () {\n this.hideMouseWheelZoomNotice();\n }.bind(this),\n duration || 2400\n );\n\n this.wrapper.classList.add('svgMap-block-zoom-notice-active');\n }\n\n // Hide the zoom with keys notice\n\n hideMouseWheelZoomNotice() {\n this.wrapper.classList.remove('svgMap-block-zoom-notice-active');\n this.autoHideMouseWheelNoticeTimeout &&\n clearTimeout(this.autoHideMouseWheelNoticeTimeout);\n }\n\n // Block shing the zoom wheel notice for some time\n\n blockMouseWheelZoomNotice(duration) {\n this.mouseWheelNoticeJustHidden = true;\n this.mouseWheelNoticeJustHiddenTimeout &&\n clearTimeout(this.mouseWheelNoticeJustHiddenTimeout);\n this.mouseWheelNoticeJustHiddenTimeout = setTimeout(\n function () {\n this.mouseWheelNoticeJustHidden = false;\n }.bind(this),\n duration || 600\n );\n }\n\n // Add the events when you are only allowed to scrool with a key pressed\n\n addMouseWheelZoomWithKeyEvents() {\n // Add events to wrapper\n this.wrapper.addEventListener(\n 'wheel',\n function (ev) {\n if (!document.body.classList.contains('svgMap-zoom-key-pressed')) {\n this.showMouseWheelZoomNotice();\n } else {\n this.hideMouseWheelZoomNotice();\n this.blockMouseWheelZoomNotice();\n }\n }.bind(this),\n {\n passive: true\n }\n );\n\n // Add with keydown\n document.addEventListener(\n 'keydown',\n function (ev) {\n if (\n ev.key == 'Alt' ||\n ev.key == 'Control' ||\n ev.key == 'Meta' ||\n ev.key == 'Shift'\n ) {\n document.body.classList.add('svgMap-zoom-key-pressed');\n this.hideMouseWheelZoomNotice();\n this.blockMouseWheelZoomNotice();\n }\n }.bind(this)\n );\n\n // Fallback with wheel as sometimes it wont trigger when window is out of focus\n this.wrapper.addEventListener('wheel', function (ev) {\n if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) {\n document.body.classList.add('svgMap-zoom-key-pressed');\n // TODO wont be removed when window out of focus\n }\n });\n\n // Only add following events to the document once\n if (document.body.classList.contains('svgMap-key-events-added')) {\n return false;\n }\n document.body.classList.add('svgMap-key-events-added');\n\n // Remove with keyup\n document.addEventListener('keyup', function (ev) {\n if (\n ev.key == 'Alt' ||\n ev.key == 'Control' ||\n ev.key == 'Meta' ||\n ev.key == 'Shift'\n ) {\n document.body.classList.remove('svgMap-zoom-key-pressed');\n }\n });\n }\n\n // Map paths\n\n mapPaths = {\n 'AF': {\n d: 'M1369.9,333.8h-5.4l-3.8-0.5l-2.5,2.9l-2.1,0.7l-1.5,1.3l-2.6-2.1l-1-5.4l-1.6-0.3v-2l-3.2-1.5l-1.7,2.3l0.2,2.6 l-0.6,0.9l-3.2-0.1l-0.9,3l-2.1-1.3l-3.3,2.1l-1.8-0.8l-4.3-1.4h-2.9l-1.6-0.2l-2.9-1.7l-0.3,2.3l-4.1,1.2l0.1,5.2l-2.5,2l-4,0.9 l-0.4,3l-3.9,0.8l-5.9-2.4l-0.5,8l-0.5,4.7l2.5,0.9l-1.6,3.5l2.7,5.1l1.1,4l4.3,1.1l1.1,4l-3.9,5.8l9.6,3.2l5.3-0.9l3.3,0.8l0.9-1.4 l3.8,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v0.2l-0.2,0.3v0.2 l0.1,0.3l1.5-0.1l1.3-0.2l0.7-0.9L574.4,437.3z M575.2,435.3l-0.4-0.3l-0.4,0.3l0.1,0.3L575.2,435.3L575.2,435.3z M575.2,429.5 l-0.4-0.2l-0.3,0.5l0.3,0.1l0.7-0.1l0.5,0.1l0.5,0.4l0.3-0.2l-0.1-0.1l-0.4-0.3l-0.6-0.1h-0.2L575.2,429.5L575.2,429.5z M568.6,430.8l0.7-0.6l0.7-0.3l0.9-1.1l-0.1-0.9l0.2-0.4l-0.6,0.1l-0.1,0.3l-0.1,0.3l0.3,0.4v0.2l-0.2,0.4l-0.3,0.1l-0.1,0.2 l-0.3,0.1l-0.4,0.5l-0.8,0.6l-0.2,0.3L568.6,430.8L568.6,430.8z M569.8,427.6l-0.6-0.2L569,427l-0.4-0.1l-0.1,0.2v0.2l0.1,0.4 l0.2-0.1l0.8,0.4l0.4-0.3L569.8,427.6z M565.7,426.5v-0.7l-0.4-0.5l-0.6-0.4l-0.1-1.2l-0.3-0.7l-0.2-0.6l-0.4-0.8v0.5l0.1,0.1 l0.1,0.6l0.4,0.9l0.1,0.4l-0.1,0.4l-0.4,0.1l-0.1,0.2l0.5,0.3l0.8,0.3l0.5,1.3L565.7,426.5L565.7,426.5z M561.6,423l-0.5-0.3 l-0.2-0.3l-0.7-0.7l-0.3-0.1l-0.2,0.4l0.4,0.1l0.9,0.7l0.4,0.2L561.6,423L561.6,423z M568.9,419l-0.1-0.3h-0.1l-0.3,0.1l-0.3,0.9 h0.3L568.9,419L568.9,419z M551.3,417.9l-0.2-0.3l-0.3,0.2h-0.5l-0.2,0.1h-0.4l-0.3,0.2l0.4,0.8l0.3,0.3l0.1,1l0.2,0.1l-0.1,0.7 l1.1,0.1l0.4-0.8V420v-0.1v-0.2v-0.2v-0.9l-0.3-0.5l-0.4,0.6l-0.4-0.3l0.6-0.4L551.3,417.9L551.3,417.9z M564.2,418.2l-1-1.4v-0.2 l-0.5-1.5l-0.3-0.1l-0.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