Guest User

Untitled

a guest
Jan 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. var locations = [
  2. ['Bondi Beach', -33.890542, 151.274856, 4],
  3. ['Coogee Beach', -33.923036, 151.259052, 5],
  4. ['Cronulla Beach', -34.028249, 151.157507, 3],
  5. ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
  6. ['Maroubra Beach', -33.950198, 151.259302, 1]
  7. ];
  8.  
  9. var map = new google.maps.Map(document.getElementById('map'), {
  10. zoom: 10,
  11. center: new google.maps.LatLng(-33.92, 151.25),
  12. mapTypeId: google.maps.MapTypeId.ROADMAP
  13. });
  14.  
  15. var infowindow = new google.maps.InfoWindow();
  16.  
  17. var marker, i;
  18.  
  19. for (i = 0; i < locations.length; i++) {
  20. marker = new google.maps.Marker({
  21. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  22. map: map
  23. });
  24.  
  25. google.maps.event.addListener(marker, 'click', (function(marker, i) {
  26. return function() {
  27. infowindow.setContent(locations[i][0]);
  28. infowindow.open(map, marker);
  29. }
  30. })(marker, i));
  31. }
  32.  
  33. var locations = [
  34. ['Bondi Beach', -33.890542, 151.274856, 4, "http://i.imgur.com/GyqbZzs.gif"],
  35. ['Coogee Beach', -33.923036, 151.259052, 5, "http://i.imgur.com/LTCOHYH.gif"],
  36. ['Cronulla Beach', -34.028249, 151.157507, 3, "http://i.imgur.com/4CCFNWR.gif"],
  37. ['Manly Beach', -33.80010128657071, 151.28747820854187, 2, "http://i.imgur.com/dRIZ8LN.gif"],
  38. ['Maroubra Beach', -33.950198, 151.259302, 1, "http://i.imgur.com/WjZlFve.gif"]
  39. ];
  40.  
  41. marker = new google.maps.Marker({
  42. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  43. map: map,
  44. icon: locations[i][4]
  45. });
  46.  
  47. var locations = [
  48. ['Bondi Beach', -33.890542, 151.274856, 4, "http://i.imgur.com/GyqbZzs.gif"],
  49. ['Coogee Beach', -33.923036, 151.259052, 5, "http://i.imgur.com/LTCOHYH.gif"],
  50. ['Cronulla Beach', -34.028249, 151.157507, 3, "http://i.imgur.com/4CCFNWR.gif"],
  51. ['Manly Beach', -33.80010128657071, 151.28747820854187, 2, "http://i.imgur.com/dRIZ8LN.gif"],
  52. ['Maroubra Beach', -33.950198, 151.259302, 1, "http://i.imgur.com/WjZlFve.gif"]
  53. ];
  54.  
  55. var map = new google.maps.Map(document.getElementById('map'), {
  56. zoom: 10,
  57. center: new google.maps.LatLng(-33.92, 151.25),
  58. mapTypeId: google.maps.MapTypeId.ROADMAP
  59. });
  60.  
  61. var infowindow = new google.maps.InfoWindow();
  62.  
  63. var marker, i;
  64.  
  65. for (i = 0; i < locations.length; i++) {
  66. marker = new google.maps.Marker({
  67. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  68. map: map,
  69. icon: locations[i][4]
  70. });
  71.  
  72. google.maps.event.addListener(marker, 'click', (function(marker, i) {
  73. return function() {
  74. infowindow.setContent(locations[i][0]);
  75. infowindow.open(map, marker);
  76. }
  77. })(marker, i));
  78. }
  79.  
  80. var locations = [
  81. ['Bondi Beach', -33.890542, 151.274856, 4, 'ruta/a/tu/imagen1.png'],
  82. ['Coogee Beach', -33.923036, 151.259052, 5, 'ruta/a/tu/imagen2.png'],
  83. ['Cronulla Beach', -34.028249, 151.157507, 3, 'ruta/a/tu/imagen3.png'],
  84. ['Manly Beach', -33.80010128657071, 151.28747820854187, 2, 'ruta/a/tu/imagen4.png'],
  85. ['Maroubra Beach', -33.950198, 151.259302, 1, 'ruta/a/tu/imagen5.png']
  86. ];
  87.  
  88. var marker = new google.maps.Marker({
  89. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  90. map: map,
  91. icon: locations[i][4]
  92. });
Add Comment
Please, Sign In to add comment