be_comp_maps_vector.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Document : be_comp_maps_vector.js
  3. * Author : pixelcave
  4. * Description: Custom JS code used in Vector Maps Page
  5. */
  6. var BeCompMapsVector = function() {
  7. // jVectorMap, for more examples you can check out http://jvectormap.com/documentation/
  8. // Set default options for all maps
  9. var mapOptions = {
  10. map: '',
  11. backgroundColor: '#ffffff',
  12. regionStyle: {
  13. initial: {
  14. fill: '#42a5f5',
  15. 'fill-opacity': 1,
  16. stroke: 'none',
  17. 'stroke-width': 0,
  18. 'stroke-opacity': 1
  19. },
  20. hover: {
  21. 'fill-opacity': .8,
  22. cursor: 'pointer'
  23. }
  24. }
  25. };
  26. // Init World Map
  27. var initMapWorld = function(){
  28. // Set Active Map
  29. mapOptions['map'] = 'world_mill_en';
  30. // Init Map
  31. jQuery('.js-vector-map-world').vectorMap(mapOptions);
  32. };
  33. // Init Europe Map
  34. var initMapEurope = function(){
  35. // Set Active Map
  36. mapOptions['map'] = 'europe_mill_en';
  37. // Init Map
  38. jQuery('.js-vector-map-europe').vectorMap(mapOptions);
  39. };
  40. // Init USA Map
  41. var initMapUsa = function(){
  42. // Set Active Map
  43. mapOptions['map'] = 'us_aea_en';
  44. // Init Map
  45. jQuery('.js-vector-map-usa').vectorMap(mapOptions);
  46. };
  47. // Init India Map
  48. var initMapIndia = function(){
  49. // Set Active Map
  50. mapOptions['map'] = 'in_mill_en';
  51. // Init Map
  52. jQuery('.js-vector-map-india').vectorMap(mapOptions);
  53. };
  54. // Init China Map
  55. var initMapChina = function(){
  56. // Set Active Map
  57. mapOptions['map'] = 'cn_mill_en';
  58. // Init Map
  59. jQuery('.js-vector-map-china').vectorMap(mapOptions);
  60. };
  61. // Init Australia Map
  62. var initMapAustralia = function(){
  63. // Set Active Map
  64. mapOptions['map'] = 'au_mill_en';
  65. // Init Map
  66. jQuery('.js-vector-map-australia').vectorMap(mapOptions);
  67. };
  68. // Init South Africa Map
  69. var initMapSouthAfrica = function(){
  70. // Set Active Map
  71. mapOptions['map'] = 'za_mill_en';
  72. // Init Map
  73. jQuery('.js-vector-map-south-africa').vectorMap(mapOptions);
  74. };
  75. // Init France Map
  76. var initMapFrance = function(){
  77. // Set Active Map
  78. mapOptions['map'] = 'fr_mill_en';
  79. // Init Map
  80. jQuery('.js-vector-map-france').vectorMap(mapOptions);
  81. };
  82. // Init Germany Map
  83. var initMapGermany = function(){
  84. // Set Active Map
  85. mapOptions['map'] = 'de_mill_en';
  86. // Init Map
  87. jQuery('.js-vector-map-germany').vectorMap(mapOptions);
  88. };
  89. return {
  90. init: function () {
  91. // Init Example Maps
  92. initMapWorld();
  93. initMapEurope();
  94. initMapUsa();
  95. initMapIndia();
  96. initMapChina();
  97. initMapAustralia();
  98. initMapSouthAfrica();
  99. initMapFrance();
  100. initMapGermany();
  101. }
  102. };
  103. }();
  104. // Initialize when page loads
  105. jQuery(function(){ BeCompMapsVector.init(); });