labels.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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: red;
  23. -webkit-tap-highlight-color: rgba(0,0,0,0);
  24. }
  25. /* Setup basic CSS for Label */
  26. .jqvmap-pin {
  27. font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
  28. cursor: default;
  29. pointer-events: none;
  30. }
  31. /* Hide Whichever Labels you want */
  32. #jqvmap1_ri_pin, #jqvmap1_dc_pin, #jqvmap1_de_pin, #jqvmap1_md_pin {
  33. display: none;
  34. }
  35. /* Reposition Labels that are not quite right ( labels are centered in shape, and sometimes need tweaking ) */
  36. #jqvmap1_ak_pin {
  37. margin-top: -2%;
  38. }
  39. #jqvmap1_ca_pin {
  40. margin-left: -2%;
  41. }
  42. #jqvmap1_ct_pin {
  43. margin-top: -0.25%;
  44. margin-left: -0.25%;
  45. }
  46. #jqvmap1_fl_pin {
  47. margin-left: 5%;
  48. }
  49. #jqvmap1_id_pin {
  50. margin-top: 3%;
  51. margin-left: -1%;
  52. }
  53. #jqvmap1_ky_pin {
  54. margin-left: 2%;
  55. }
  56. #jqvmap1_la_pin {
  57. margin-left: -2%;
  58. }
  59. #jqvmap1_mi_pin {
  60. margin-top: 4%;
  61. margin-left: 3%;
  62. }
  63. #jqvmap1_ma_pin {
  64. margin-top: -0.25%;
  65. }
  66. #jqvmap1_mn_pin {
  67. margin-top: 2%;
  68. margin-left: -2%;
  69. }
  70. #jqvmap1_nh_pin {
  71. margin-top: 1%;
  72. margin-left: -0.25%;
  73. }
  74. #jqvmap1_nj_pin {
  75. margin-top: 1%;
  76. }
  77. #jqvmap1_ok_pin {
  78. margin-left: 2%;
  79. }
  80. #jqvmap1_va_pin {
  81. margin-left: 2%;
  82. }
  83. #jqvmap1_wv_pin {
  84. margin-left: -1%;
  85. margin-top: 1%;
  86. }
  87. /* Add responsibe support to resize labels for difference screen sizes */
  88. @media only screen and (min-width: 320px) {
  89. .jqvmap-pin {
  90. font-size: 6px;
  91. }
  92. }
  93. @media only screen and (min-width: 480px) {
  94. .jqvmap-pin {
  95. font-size: 8px;
  96. }
  97. }
  98. @media only screen and (min-width: 640px) {
  99. .jqvmap-pin {
  100. font-size: 10px;
  101. }
  102. }
  103. @media only screen and (min-width: 800px) {
  104. .jqvmap-pin {
  105. font-size: 12px;
  106. }
  107. }
  108. @media only screen and (min-width: 1024px) {
  109. .jqvmap-pin {
  110. font-size: 14px;
  111. }
  112. }
  113. </style>
  114. <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
  115. <script type="text/javascript" src="../dist/jquery.vmap.js"></script>
  116. <script type="text/javascript" src="../dist/maps/jquery.vmap.usa.js" charset="utf-8"></script>
  117. <script>
  118. jQuery(document).ready(function () {
  119. jQuery('#vmap').vectorMap({
  120. map: 'usa_en',
  121. borderWidth: 0.25,
  122. showLabels: true
  123. });
  124. });
  125. </script>
  126. </head>
  127. <body>
  128. <div id="vmap"></div>
  129. </body>
  130. </html>