Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. if($('#map').is_exists() && kta_ajax.map_latitude && kta_ajax.map_longitude) {
  2. google.maps.event.addDomListener(window, 'load', init);
  3. } // End is_exists
  4. // When the window has finished loading create our google map below
  5.  
  6. function init() {
  7. // Basic options for a simple Google Map
  8. // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
  9. var mapOptions = {
  10. zoom: 11,
  11. scrollwheel: false,
  12. navigationControl: false,
  13. mapTypeControl: true,
  14. scaleControl: false,
  15. draggable: true,
  16. disableDefaultUI: true,
  17.  
  18. // The latitude and longitude to center the map (always required)
  19. center: new google.maps.LatLng(kta_ajax.map_latitude, kta_ajax.map_longitude), // New York
  20.  
  21. // How you would like to style the map.
  22. // This is where you would paste any style found on Snazzy Maps.
  23. styles: [
  24. {
  25. "featureType": "administrative",
  26. "elementType": "labels.text.fill",
  27. "stylers": [
  28. {
  29. "color": "#444444"
  30. }
  31. ]
  32. },
  33. {
  34. "featureType": "landscape",
  35. "elementType": "all",
  36. "stylers": [
  37. {
  38. "color": "#f2f2f2"
  39. }
  40. ]
  41. },
  42. {
  43. "featureType": "poi",
  44. "elementType": "all",
  45. "stylers": [
  46. {
  47. "visibility": "off"
  48. }
  49. ]
  50. },
  51. {
  52. "featureType": "road",
  53. "elementType": "all",
  54. "stylers": [
  55. {
  56. "saturation": -100
  57. },
  58. {
  59. "lightness": 45
  60. }
  61. ]
  62. },
  63. {
  64. "featureType": "road.highway",
  65. "elementType": "all",
  66. "stylers": [
  67. {
  68. "visibility": "simplified"
  69. }
  70. ]
  71. },
  72. {
  73. "featureType": "road.arterial",
  74. "elementType": "labels.icon",
  75. "stylers": [
  76. {
  77. "visibility": "off"
  78. }
  79. ]
  80. },
  81. {
  82. "featureType": "transit",
  83. "elementType": "all",
  84. "stylers": [
  85. {
  86. "visibility": "off"
  87. }
  88. ]
  89. },
  90. {
  91. "featureType": "water",
  92. "elementType": "all",
  93. "stylers": [
  94. {
  95. "color": "#BFD62E"
  96. },
  97. {
  98. "visibility": "on"
  99. }
  100. ]
  101. }
  102. ]
  103. };
  104.  
  105.  
  106. // Get the HTML DOM element that will contain your map
  107. // We are using a div with id="map" seen below in the <body>
  108. var mapElement = document.getElementById('map');
  109.  
  110. // Create the Google Map using our element and options defined above
  111. var map = new google.maps.Map(mapElement, mapOptions);
  112.  
  113. // Let's also add a marker while we're at it
  114. var marker = new google.maps.Marker({
  115. position: new google.maps.LatLng(kta_ajax.map_latitude, kta_ajax.map_longitude),
  116. map: map,
  117. title: 'Kingston College!'
  118. });
  119. map.panBy(-200, 0);
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement