svgmap 2.18.0 → 2.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <title>Localize country names</title>
3
+ <meta charset="utf-8">
4
+
5
+ <script>var svgMap = function () {};</script>
6
+ <script src="../src/js/svgMap/countries.js"></script>
7
+ <script>var svgMapCountries = new svgMap();</script>
8
+
9
+ <div style="padding: 20px 80px; font-family: monospace; font-size: 12px">
10
+ <b>Missing translations</b>
11
+ <div id="missing-countries" style="padding: 15px 0; color: #DD0000"></div>
12
+ <b>Translated countries</b>
13
+ <div style="padding: 15px 0; word-break: break-all; white-space: pre">var svgMapCountryNames = {<div id="data"></div>};</div>
14
+ </div>
15
+
16
+ <script src="./countries.js"></script>
17
+
18
+ <script>
19
+ var missingCountriesOutput = document.getElementById('missing-countries');
20
+ var dataOutput = document.getElementById('data');
21
+ var map = document.getElementById('map');
22
+ var countriesEN = svgMapCountries.countries;
23
+
24
+ Object.keys(countriesEN).forEach(function (countryID, index) {
25
+ if (!countries || !countries[countryID]) {
26
+ var element = document.createElement('div');
27
+ element.innerHTML = countryID + ' | ' + countriesEN[countryID];
28
+ missingCountriesOutput.appendChild(element);
29
+ return;
30
+ }
31
+ var element = document.createElement('div');
32
+ element.innerHTML = ' ' + countryID + ': \'' + countries[countryID] + '\'' + (index + 1 < Object.keys(countriesEN).length ? ',' : '');
33
+ dataOutput.appendChild(element);
34
+ });
35
+ </script>