jvectormap.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. ! function($) {
  2. "use strict";
  3. var VectorMap = function() {};
  4. VectorMap.prototype.init = function() {
  5. //various examples
  6. $('#world-map-markers').vectorMap({
  7. map: 'world_mill_en',
  8. scaleColors: ['#6c5ffc', '#6c5ffc'],
  9. normalizeFunction: 'polynomial',
  10. hoverOpacity: 0.7,
  11. hoverColor: false,
  12. regionStyle: {
  13. initial: {
  14. fill: '#edf0f5'
  15. }
  16. },
  17. markerStyle: {
  18. initial: {
  19. r: 9,
  20. 'fill': '#6c5ffc',
  21. 'fill-opacity': 0.9,
  22. 'stroke': '#fff',
  23. 'stroke-width': 9,
  24. 'stroke-opacity': 0.2
  25. },
  26. hover: {
  27. 'stroke': '#fff',
  28. 'fill-opacity': 1,
  29. 'stroke-width': 1.5
  30. }
  31. },
  32. backgroundColor: 'transparent',
  33. markers: [{
  34. latLng: [41.90, 12.45],
  35. name: 'Vatican City'
  36. }, {
  37. latLng: [43.73, 7.41],
  38. name: 'Monaco'
  39. }, {
  40. latLng: [-0.52, 166.93],
  41. name: 'Nauru'
  42. }, {
  43. latLng: [-8.51, 179.21],
  44. name: 'Tuvalu'
  45. }, {
  46. latLng: [43.93, 12.46],
  47. name: 'San Marino'
  48. }, {
  49. latLng: [47.14, 9.52],
  50. name: 'Liechtenstein'
  51. }, {
  52. latLng: [7.11, 171.06],
  53. name: 'Marshall Islands'
  54. }, {
  55. latLng: [17.3, -62.73],
  56. name: 'Saint Kitts and Nevis'
  57. }, {
  58. latLng: [3.2, 73.22],
  59. name: 'Maldives'
  60. }, {
  61. latLng: [35.88, 14.5],
  62. name: 'Malta'
  63. }, {
  64. latLng: [12.05, -61.75],
  65. name: 'Grenada'
  66. }, {
  67. latLng: [13.16, -61.23],
  68. name: 'Saint Vincent and the Grenadines'
  69. }, {
  70. latLng: [13.16, -59.55],
  71. name: 'Barbados'
  72. }, {
  73. latLng: [17.11, -61.85],
  74. name: 'Antigua and Barbuda'
  75. }, {
  76. latLng: [-4.61, 55.45],
  77. name: 'Seychelles'
  78. }, {
  79. latLng: [7.35, 134.46],
  80. name: 'Palau'
  81. }, {
  82. latLng: [42.5, 1.51],
  83. name: 'Andorra'
  84. }, {
  85. latLng: [14.01, -60.98],
  86. name: 'Saint Lucia'
  87. }, {
  88. latLng: [6.91, 158.18],
  89. name: 'Federated States of Micronesia'
  90. }, {
  91. latLng: [1.3, 103.8],
  92. name: 'Singapore'
  93. }, {
  94. latLng: [1.46, 173.03],
  95. name: 'Kiribati'
  96. }, {
  97. latLng: [-21.13, -175.2],
  98. name: 'Tonga'
  99. }, {
  100. latLng: [15.3, -61.38],
  101. name: 'Dominica'
  102. }, {
  103. latLng: [-20.2, 57.5],
  104. name: 'Mauritius'
  105. }, {
  106. latLng: [26.02, 50.55],
  107. name: 'Bahrain'
  108. }, {
  109. latLng: [0.33, 6.73],
  110. name: 'São Tomé and Príncipe'
  111. }]
  112. });
  113. $('#vmap2').vectorMap({
  114. map: 'asia_mill',
  115. showTooltip: true,
  116. backgroundColor: null,
  117. regionStyle: {
  118. initial: {
  119. fill: '#3366ff'
  120. }
  121. },
  122. });
  123. $('#vmap3').vectorMap({
  124. map: 'au_mill',
  125. backgroundColor: null,
  126. showLabels: true,
  127. regionStyle: {
  128. initial: {
  129. fill: '#00cccc'
  130. }
  131. },
  132. });
  133. $('#vmap4').vectorMap({
  134. map: 'ca_lcc',
  135. color: '#00cccc',
  136. borderColor: '#fff',
  137. backgroundColor: null,
  138. hoverColor: '#00cccc',
  139. showLabels: true,
  140. regionStyle: {
  141. initial: {
  142. fill: '#2dce89'
  143. }
  144. },
  145. });
  146. $('#vmap5').vectorMap({
  147. map: 'de_mill',
  148. color: '#3bb001',
  149. borderColor: '#fff',
  150. backgroundColor: null,
  151. hoverColor: '#212229',
  152. showLabels: true,
  153. regionStyle: {
  154. initial: {
  155. fill: '#45aaf2'
  156. }
  157. },
  158. });
  159. $('#vmap6').vectorMap({
  160. map: 'europe_mill_en',
  161. color: '#dc3545',
  162. borderColor: '#fff',
  163. backgroundColor: null,
  164. hoverColor: '#dc3545',
  165. showLabels: true,
  166. regionStyle: {
  167. initial: {
  168. fill: '#ecb403'
  169. }
  170. },
  171. });
  172. $('#vmap7').vectorMap({
  173. map: 'in_mill',
  174. color: '#ea614c',
  175. borderColor: '#fff',
  176. backgroundColor: null,
  177. hoverColor: '#ea614c',
  178. showLabels: true,
  179. regionStyle: {
  180. initial: {
  181. fill: '#ff5b51'
  182. }
  183. },
  184. });
  185. $('#vmap8').vectorMap({
  186. map: 'uk_mill_en',
  187. color: '#3db4ec',
  188. borderColor: '#fff',
  189. backgroundColor: null,
  190. hoverColor: '#3db4ec',
  191. showLabels: true,
  192. regionStyle: {
  193. initial: {
  194. fill: '#2bcbba'
  195. }
  196. },
  197. });
  198. $('#vmap9').vectorMap({
  199. map: 'us_aea_en',
  200. color: '#f10075',
  201. borderColor: '#fff',
  202. backgroundColor: null,
  203. hoverColor: '#f10075',
  204. showLabels: true,
  205. regionStyle: {
  206. initial: {
  207. fill: '#1e74a0'
  208. }
  209. },
  210. });
  211. },
  212. //init
  213. $.VectorMap = new VectorMap, $.VectorMap.Constructor =
  214. VectorMap
  215. }(window.jQuery),
  216. //initializing
  217. function($) {
  218. "use strict";
  219. $.VectorMap.init()
  220. }(window.jQuery);