pins_custom.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>JQVMap - USA Map</title>
  6. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  7. <!-- Mobile Specific Meta Tags -->
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <link href="../dist/jqvmap.css" media="screen" rel="stylesheet" type="text/css"/>
  12. <style>
  13. html, body {
  14. padding: 0;
  15. margin: 0;
  16. width: 100%;
  17. height: 100%;
  18. }
  19. #vmap {
  20. width: 100%;
  21. height: 100%;
  22. background-color: #333;
  23. -webkit-tap-highlight-color: rgba(0,0,0,0);
  24. }
  25. .jqvmap-region {
  26. cursor: default !important;
  27. }
  28. .map-pin {
  29. width: 64px;
  30. height: 50px;
  31. position: absolute;
  32. top: -25px;
  33. left: -32px;
  34. background-size: 32px 32px;
  35. background-repeat: no-repeat;
  36. text-align: center;
  37. background-position: top center;
  38. color: #888;
  39. font-weight: 500;
  40. font-size: 14px;
  41. }
  42. .map-pin span {
  43. position: absolute;
  44. bottom: 0;
  45. width: 100%;
  46. text-align: center;
  47. left: 0;
  48. }
  49. .red {
  50. background-image: url('images/marker/red.png');
  51. }
  52. .blue {
  53. background-image: url('images/marker/blue.png');
  54. }
  55. .purple {
  56. background-image: url('images/marker/purple.png');
  57. }
  58. /* Setup basic CSS for Label */
  59. .jqvmap-pin {
  60. font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
  61. cursor: default;
  62. }
  63. /* Reposition Labels that are not quite right ( labels are centered in shape, and sometimes need tweaking ) */
  64. #jqvmap1_fl_pin {
  65. margin-left: 5%;
  66. }
  67. </style>
  68. <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
  69. <script type="text/javascript" src="../dist/jquery.vmap.js"></script>
  70. <script type="text/javascript" src="../dist/maps/jquery.vmap.usa.js" charset="utf-8"></script>
  71. <script>
  72. function escapeXml(string) {
  73. return string.replace(/[<>]/g, function (c) {
  74. switch (c) {
  75. case '<': return '\u003c';
  76. case '>': return '\u003e';
  77. }
  78. });
  79. }
  80. jQuery(document).ready(function () {
  81. var pins = {
  82. mo: escapeXml('<div class="map-pin red"><span>MO</span></div>'),
  83. fl: escapeXml('<div class="map-pin blue"><span>FL</span></div>'),
  84. or: escapeXml('<div class="map-pin purple"><span>OR</span></div>')
  85. };
  86. jQuery('#vmap').vectorMap({
  87. backgroundColor: '#333',
  88. borderColor: '#333',
  89. map: 'usa_en',
  90. pins: pins,
  91. color: '#fff',
  92. pinMode: 'content',
  93. hoverColor: null,
  94. selectedColor: '#111',
  95. showTooltip: false,
  96. selectedRegions: ['MO', 'FL', 'OR'],
  97. onRegionClick: function(event){
  98. event.preventDefault();
  99. }
  100. });
  101. });
  102. </script>
  103. </head>
  104. <body>
  105. <div id="vmap"></div>
  106. </body>
  107. </html>