Advertisement
pixel-industry

Untitled

Aug 14th, 2015
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. <script>
  2. /* <![CDATA[ */
  3. jQuery(document).ready(function ($) {
  4. 'use strict';
  5. // GOOGLE MAPS START
  6. var locations = [
  7. ['London Trucking Headquarters', 51.50013, -0, 126305, 4],
  8. ['Trucking Headquarters Paris', 48.8566667, 2.3509871, 5],
  9. ['Trucking Warehouse, Oslo', 59.9138204, 10.7387413, 3],
  10. ['Trucking Vehicle Fleet, Rome', 41.8954656, 12.4823243, 2],
  11. ['Trucking Support Center, Madrid', 40.4166909, -3.7003454, 1],
  12. ['Trucking airport, Moscow', 55.755786, 37.617633, 6],
  13. ['Trucking Warehouse, Prague', 50.0878114, 14.4204598, 7],
  14. ['Trucking Warehouse, Quebec', 52.9399159, -73.5491361, 8],
  15. ['Trucking Headquarters, Ontario', 51.590723, -86.396484, 9],
  16. ['Trucking Vehicle Fleet, Montana', 46.860191, -109.599609, 10],
  17. ['Trucking Support Center, Alberta', 56.46249, -114.960937, 11],
  18. ['Trucking Vehicle Fleet, Yukon', 63.332413, -136.098633, 12],
  19. ['Trucking Headquarters Minesota', 46.729553, -94.6858998, 13],
  20. ['Trucking Headquarters Virginia Beach', 36.8529263, -75.977985, 14],
  21. ['Trucking Headquarters Chicago', 41.850033, -87.6500523, 15],
  22. ['Trucking Headquarters Athens', 37.926868, 23.730469, 16],
  23. ['Trucking Headquarters New Delhi', 28.574874, 77.299805, 17]
  24. ];
  25.  
  26.  
  27. var style = [
  28. {"featureType": "road",
  29. "elementType":
  30. "labels.icon",
  31. "stylers": [
  32. {"saturation": 1},
  33. {"gamma": 1},
  34. {"visibility": "on"},
  35. {"hue": "#e6ff00"}
  36. ]
  37. },
  38. {"elementType": "geometry", "stylers": [
  39. {"saturation": -85}
  40. ]
  41. }
  42. ];
  43.  
  44. var map = new google.maps.Map(document.getElementById('map'), {
  45. // SET THE CENTER
  46. center: new google.maps.LatLng(50.0878114, 14.4204598),
  47. // SET THE MAP STYLE & ZOOM LEVEL
  48. mapTypeId: google.maps.MapTypeId.ROADMAP,
  49. zoom: 3,
  50. // SET THE BACKGROUND COLOUR
  51. backgroundColor: "#eeeeee",
  52. // REMOVE ALL THE CONTROLS EXCEPT ZOOM
  53. panControl: true,
  54. zoomControl: true,
  55. mapTypeControl: true,
  56. scaleControl: true,
  57. streetViewControl: true,
  58. overviewMapControl: true,
  59. scrollwheel: false,
  60. zoomControlOptions: {
  61. style: google.maps.ZoomControlStyle.SMALL
  62. }
  63. });
  64.  
  65. var mapType = new google.maps.StyledMapType(style, {name: "Grayscale"});
  66. map.mapTypes.set('grey', mapType);
  67. map.setMapTypeId('grey');
  68.  
  69. var infowindow = new google.maps.InfoWindow();
  70.  
  71. //CREATE A CUSTOM PIN ICON
  72. var marker_image = 'img/pin.png';
  73. var pinIcon = new google.maps.MarkerImage(marker_image, null, null, null, new google.maps.Size(21, 34));
  74.  
  75. var marker, i;
  76.  
  77. for (i = 0; i < locations.length; i++) {
  78. marker = new google.maps.Marker({
  79. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  80. map: map,
  81. icon: pinIcon
  82. });
  83.  
  84. // Add circle overlay and bind to marker
  85. var circle = new google.maps.Circle({
  86. map: map,
  87. radius: 16093, // 10 miles in metres
  88. fillColor: '#AA0000'
  89. });
  90. circle.bindTo('center', marker, 'position');
  91.  
  92. google.maps.event.addListener(marker, 'click', (function (marker, i) {
  93. return function () {
  94. infowindow.setContent(locations[i][0]);
  95. infowindow.open(map, marker);
  96. }
  97. })(marker, i));
  98. }
  99. });
  100. /* ]]> */
  101. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement