vectormaps-demo.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. var gdpData = {
  2. "AF": 16.63,
  3. "AL": 11.58,
  4. "DZ": 158.97,
  5. "AO": 85.81,
  6. "AG": 1.1,
  7. "AR": 351.02,
  8. "AM": 8.83,
  9. "AU": 1219.72,
  10. "AT": 366.26,
  11. "AZ": 52.17,
  12. "BS": 7.54,
  13. "BH": 21.73,
  14. "BD": 105.4,
  15. "BB": 3.96,
  16. "BY": 52.89,
  17. "BE": 461.33,
  18. "BZ": 1.43,
  19. "BJ": 6.49,
  20. "BT": 1.4,
  21. "BO": 19.18,
  22. "BA": 16.2,
  23. "BW": 12.5,
  24. "BR": 2023.53,
  25. "BN": 11.96,
  26. "BG": 44.84,
  27. "BF": 8.67,
  28. "BI": 1.47,
  29. "KH": 11.36,
  30. "CM": 21.88,
  31. "CA": 1563.66,
  32. "CV": 1.57,
  33. "CF": 2.11,
  34. "TD": 7.59,
  35. "CL": 199.18,
  36. "CN": 5745.13,
  37. "CO": 283.11,
  38. "KM": 0.56,
  39. "CD": 12.6,
  40. "CG": 11.88,
  41. "CR": 35.02,
  42. "CI": 22.38,
  43. "HR": 59.92,
  44. "CY": 22.75,
  45. "CZ": 195.23,
  46. "DK": 304.56,
  47. "DJ": 1.14,
  48. "DM": 0.38,
  49. "DO": 50.87,
  50. "EC": 61.49,
  51. "EG": 216.83,
  52. "SV": 21.8,
  53. "GQ": 14.55,
  54. "ER": 2.25,
  55. "EE": 19.22,
  56. "ET": 30.94,
  57. "FJ": 3.15,
  58. "FI": 231.98,
  59. "FR": 2555.44,
  60. "GA": 12.56,
  61. "GM": 1.04,
  62. "GE": 11.23,
  63. "DE": 3305.9,
  64. "GH": 18.06,
  65. "GR": 305.01,
  66. "GD": 0.65,
  67. "GT": 40.77,
  68. "GN": 4.34,
  69. "GW": 0.83,
  70. "GY": 2.2,
  71. "HT": 6.5,
  72. "HN": 15.34,
  73. "HK": 226.49,
  74. "HU": 132.28,
  75. "IS": 12.77,
  76. "IN": 1430.02,
  77. "ID": 695.06,
  78. "IR": 337.9,
  79. "IQ": 84.14,
  80. "IE": 204.14,
  81. "IL": 201.25,
  82. "IT": 2036.69,
  83. "JM": 13.74,
  84. "JP": 5390.9,
  85. "JO": 27.13,
  86. "KZ": 129.76,
  87. "KE": 32.42,
  88. "KI": 0.15,
  89. "KR": 986.26,
  90. "UNDEFINED": 5.73,
  91. "KW": 117.32,
  92. "KG": 4.44,
  93. "LA": 6.34,
  94. "LV": 23.39,
  95. "LB": 39.15,
  96. "LS": 1.8,
  97. "LR": 0.98,
  98. "LY": 77.91,
  99. "LT": 35.73,
  100. "LU": 52.43,
  101. "MK": 9.58,
  102. "MG": 8.33,
  103. "MW": 5.04,
  104. "MY": 218.95,
  105. "MV": 1.43,
  106. "ML": 9.08,
  107. "MT": 7.8,
  108. "MR": 3.49,
  109. "MU": 9.43,
  110. "MX": 1004.04,
  111. "MD": 5.36,
  112. "MN": 5.81,
  113. "ME": 3.88,
  114. "MA": 91.7,
  115. "MZ": 10.21,
  116. "MM": 35.65,
  117. "NA": 11.45,
  118. "NP": 15.11,
  119. "NL": 770.31,
  120. "NZ": 138,
  121. "NI": 6.38,
  122. "NE": 5.6,
  123. "NG": 206.66,
  124. "NO": 413.51,
  125. "OM": 53.78,
  126. "PK": 174.79,
  127. "PA": 27.2,
  128. "PG": 8.81,
  129. "PY": 17.17,
  130. "PE": 153.55,
  131. "PH": 189.06,
  132. "PL": 438.88,
  133. "PT": 223.7,
  134. "QA": 126.52,
  135. "RO": 158.39,
  136. "RU": 1476.91,
  137. "RW": 5.69,
  138. "WS": 0.55,
  139. "ST": 0.19,
  140. "SA": 434.44,
  141. "SN": 12.66,
  142. "RS": 38.92,
  143. "SC": 0.92,
  144. "SL": 1.9,
  145. "SG": 217.38,
  146. "SK": 86.26,
  147. "SI": 46.44,
  148. "SB": 0.67,
  149. "ZA": 354.41,
  150. "ES": 1374.78,
  151. "LK": 48.24,
  152. "KN": 0.56,
  153. "LC": 1,
  154. "VC": 0.58,
  155. "SD": 65.93,
  156. "SR": 3.3,
  157. "SZ": 3.17,
  158. "SE": 444.59,
  159. "CH": 522.44,
  160. "SY": 59.63,
  161. "TW": 426.98,
  162. "TJ": 5.58,
  163. "TZ": 22.43,
  164. "TH": 312.61,
  165. "TL": 0.62,
  166. "TG": 3.07,
  167. "TO": 0.3,
  168. "TT": 21.2,
  169. "TN": 43.86,
  170. "TR": 729.05,
  171. "TM": 0,
  172. "UG": 17.12,
  173. "UA": 136.56,
  174. "AE": 239.65,
  175. "GB": 2258.57,
  176. "US": 14624.18,
  177. "UY": 40.71,
  178. "UZ": 37.72,
  179. "VU": 0.72,
  180. "VE": 285.21,
  181. "VN": 101.99,
  182. "YE": 30.02,
  183. "ZM": 15.69,
  184. "ZW": 5.57
  185. };
  186. $(function() {
  187. $('#world-map-gdp').vectorMap({
  188. map: 'world_mill_en',
  189. backgroundColor: 'transparent',
  190. series: {
  191. regions: [{
  192. values: gdpData,
  193. scale: ['#C8EEFF', '#0071A4'],
  194. normalizeFunction: 'polynomial'
  195. }]
  196. },
  197. onLabelShow: function(e, el, code) {
  198. el.html(el.html() + ' (GDP - ' + gdpData[code] + ')');
  199. }
  200. });
  201. });
  202. $(function() {
  203. $('#world-map-markers').vectorMap({
  204. map: 'world_mill_en',
  205. backgroundColor: '#f3f3f9',
  206. scaleColors: ['#00bca4', '#1c82e1'],
  207. normalizeFunction: 'polynomial',
  208. hoverOpacity: 0.7,
  209. hoverColor: false,
  210. series: {
  211. regions: [{
  212. values: gdpData,
  213. scale: ['#C8EEFF', '#0071A4'],
  214. normalizeFunction: 'polynomial'
  215. }]
  216. },
  217. markerStyle: {
  218. initial: {
  219. fill: '#F8E23B',
  220. stroke: '#383f47'
  221. }
  222. },
  223. markers: [{
  224. latLng: [41.90, 12.45],
  225. name: 'Vatican City'
  226. }, {
  227. latLng: [43.73, 7.41],
  228. name: 'Monaco'
  229. }, {
  230. latLng: [-0.52, 166.93],
  231. name: 'Nauru'
  232. }, {
  233. latLng: [-8.51, 179.21],
  234. name: 'Tuvalu'
  235. }, {
  236. latLng: [43.93, 12.46],
  237. name: 'San Marino'
  238. }, {
  239. latLng: [47.14, 9.52],
  240. name: 'Liechtenstein'
  241. }, {
  242. latLng: [7.11, 171.06],
  243. name: 'Marshall Islands'
  244. }, {
  245. latLng: [17.3, -62.73],
  246. name: 'Saint Kitts and Nevis'
  247. }, {
  248. latLng: [3.2, 73.22],
  249. name: 'Maldives'
  250. }, {
  251. latLng: [35.88, 14.5],
  252. name: 'Malta'
  253. }, {
  254. latLng: [12.05, -61.75],
  255. name: 'Grenada'
  256. }, {
  257. latLng: [13.16, -61.23],
  258. name: 'Saint Vincent and the Grenadines'
  259. }, {
  260. latLng: [13.16, -59.55],
  261. name: 'Barbados'
  262. }, {
  263. latLng: [17.11, -61.85],
  264. name: 'Antigua and Barbuda'
  265. }, {
  266. latLng: [-4.61, 55.45],
  267. name: 'Seychelles'
  268. }, {
  269. latLng: [7.35, 134.46],
  270. name: 'Palau'
  271. }, {
  272. latLng: [42.5, 1.51],
  273. name: 'Andorra'
  274. }, {
  275. latLng: [14.01, -60.98],
  276. name: 'Saint Lucia'
  277. }, {
  278. latLng: [6.91, 158.18],
  279. name: 'Federated States of Micronesia'
  280. }, {
  281. latLng: [1.3, 103.8],
  282. name: 'Singapore'
  283. }, {
  284. latLng: [1.46, 173.03],
  285. name: 'Kiribati'
  286. }, {
  287. latLng: [-21.13, -175.2],
  288. name: 'Tonga'
  289. }, {
  290. latLng: [15.3, -61.38],
  291. name: 'Dominica'
  292. }, {
  293. latLng: [-20.2, 57.5],
  294. name: 'Mauritius'
  295. }, {
  296. latLng: [26.02, 50.55],
  297. name: 'Bahrain'
  298. }, {
  299. latLng: [0.33, 6.73],
  300. name: 'São Tomé and Príncipe'
  301. }]
  302. });
  303. });
  304. $(function() {
  305. var map,
  306. markers = [{
  307. latLng: [52.50, 13.39],
  308. name: 'Berlin'
  309. }, {
  310. latLng: [53.56, 10.00],
  311. name: 'Hamburg'
  312. }, {
  313. latLng: [48.13, 11.56],
  314. name: 'Munich'
  315. }, {
  316. latLng: [50.95, 6.96],
  317. name: 'Cologne'
  318. }, {
  319. latLng: [50.11, 8.68],
  320. name: 'Frankfurt am Main'
  321. }, {
  322. latLng: [48.77, 9.17],
  323. name: 'Stuttgart'
  324. }, {
  325. latLng: [51.23, 6.78],
  326. name: 'Düsseldorf'
  327. }, {
  328. latLng: [51.51, 7.46],
  329. name: 'Dortmund'
  330. }, {
  331. latLng: [51.45, 7.01],
  332. name: 'Essen'
  333. }, {
  334. latLng: [53.07, 8.80],
  335. name: 'Bremen'
  336. }],
  337. cityAreaData = [
  338. 887.70,
  339. 755.16,
  340. 310.69,
  341. 405.17,
  342. 248.31,
  343. 207.35,
  344. 217.22,
  345. 280.71,
  346. 210.32,
  347. 325.42
  348. ]
  349. map = new jvm.WorldMap({
  350. container: $('#map-hu'),
  351. map: 'de_merc_en',
  352. regionsSelectable: true,
  353. markersSelectable: true,
  354. markers: markers,
  355. backgroundColor: 'transparent',
  356. markerStyle: {
  357. initial: {
  358. fill: '#4DAC26'
  359. },
  360. selected: {
  361. fill: '#CA0020'
  362. }
  363. },
  364. regionStyle: {
  365. initial: {
  366. fill: '#B8E186'
  367. },
  368. selected: {
  369. fill: '#F4A582'
  370. }
  371. },
  372. series: {
  373. markers: [{
  374. attribute: 'r',
  375. scale: [5, 15],
  376. values: cityAreaData
  377. }]
  378. },
  379. onRegionSelected: function() {
  380. if (window.localStorage) {
  381. window.localStorage.setItem(
  382. 'jvectormap-selected-regions',
  383. JSON.stringify(map.getSelectedRegions())
  384. );
  385. }
  386. },
  387. onMarkerSelected: function() {
  388. if (window.localStorage) {
  389. window.localStorage.setItem(
  390. 'jvectormap-selected-markers',
  391. JSON.stringify(map.getSelectedMarkers())
  392. );
  393. }
  394. }
  395. });
  396. map.setSelectedRegions(JSON.parse(window.localStorage.getItem('jvectormap-selected-regions') || '[]'));
  397. map.setSelectedMarkers(JSON.parse(window.localStorage.getItem('jvectormap-selected-markers') || '[]'));
  398. });
  399. $(function() {
  400. $('#mall-map').vectorMap({
  401. map: 'mall',
  402. backgroundColor: 'transparent',
  403. markers: [{
  404. coords: [60, 110],
  405. name: 'Escalator 1',
  406. style: {
  407. fill: 'yellow'
  408. }
  409. }, {
  410. coords: [260, 95],
  411. name: 'Escalator 2',
  412. style: {
  413. fill: 'yellow'
  414. }
  415. }, {
  416. coords: [434, 95],
  417. name: 'Escalator 3',
  418. style: {
  419. fill: 'yellow'
  420. }
  421. }, {
  422. coords: [634, 110],
  423. name: 'Escalator 4',
  424. style: {
  425. fill: 'yellow'
  426. }
  427. }],
  428. series: {
  429. regions: [{
  430. values: {
  431. F102: 'SPORTS & OUTDOOR',
  432. F103: 'HOME DECOR',
  433. F105: 'FASHION',
  434. F106: 'OTHER',
  435. F108: 'BEAUTY & SPA',
  436. F109: 'FASHION',
  437. F110: 'BEAUTY & SPA',
  438. F111: 'URBAN FAVORITES',
  439. F114: 'SERVICES',
  440. F166: 'DINING',
  441. F167: 'FASHION',
  442. F169: 'DINING',
  443. F170: 'ENTERTAINMENT',
  444. F172: 'DINING',
  445. F174: 'DINING',
  446. F115: 'KIDS STUFF',
  447. F117: 'LIFESTYLE',
  448. F118: 'URBAN FAVORITES',
  449. F119: 'FASHION',
  450. F120: 'FASHION',
  451. F122: 'KIDS STUFF',
  452. F124: 'KIDS STUFF',
  453. F125: 'KIDS STUFF',
  454. F126: 'KIDS STUFF',
  455. F128: 'KIDS STUFF',
  456. F129: 'LIFESTYLE',
  457. F130: 'HOME DECOR',
  458. F132: 'DINING',
  459. F133: 'SPORTS & OUTDOOR',
  460. F134: 'KIDS STUFF',
  461. F135: 'LIFESTYLE',
  462. F136: 'LIFESTYLE',
  463. F139: 'KIDS STUFF',
  464. F153: 'DINING',
  465. F155: 'FASHION',
  466. F156: 'URBAN FAVORITES',
  467. F157: 'URBAN FAVORITES',
  468. F158: 'LINGERIE & UNDERWEAR',
  469. F159: 'FASHION',
  470. F160: 'FASHION',
  471. F162: 'FASHION',
  472. F164: 'FASHION',
  473. F165: 'FASHION',
  474. FR01: 'REST ROOMS',
  475. FR02: 'REST ROOMS',
  476. FR03: 'REST ROOMS',
  477. FR04: 'REST ROOMS',
  478. FFC: 'DINING'
  479. },
  480. scale: {
  481. "FASHION": "#2761ad",
  482. "LINGERIE & UNDERWEAR": "#d58aa3",
  483. "BEAUTY & SPA": "#ee549f",
  484. "URBAN FAVORITES": "#15bbba",
  485. "SPORTS & OUTDOOR": "#8864ab",
  486. "KIDS STUFF": "#ef4e36",
  487. "ENTERTAINMENT": "#e47325",
  488. "HOME DECOR": "#a2614f",
  489. "LIFESTYLE": "#8a8934",
  490. "DINING": "#73bb43",
  491. "REST ROOMS": "#6c260f",
  492. "SERVICES": "#504d7c",
  493. "OTHER": "#c7b789"
  494. }
  495. }]
  496. },
  497. onRegionLabelShow: function(e, el, code) {
  498. if (el.html() === '') {
  499. e.preventDefault();
  500. }
  501. }
  502. });
  503. });