Guest User

Untitled

a guest
Jul 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <script type="text/javascript" src="index.js" class="33.870959 -118.027830 33.803498 -118.279524 34.087291 -118.259329"></script>
  2.  
  3. function initMap()
  4. { var center = {lat: 34.046438, lng: -118.259653};
  5. var map = new google.maps.Map(document.getElementById('map'), {
  6. zoom: 9,
  7. center: center
  8. });
  9. var params = document.body.getElementsByTagName('script');
  10. query = params[0].classList;
  11.  
  12. var locations = [
  13. ['hwlo', query[0], query[1]],
  14. ['hwlo', query[2], query[3]],
  15. ['hwlo', query[4], query[5]],
  16. ];
  17.  
  18. var infowindow = new google.maps.InfoWindow({});
  19. var marker, count;
  20. for (count = 0; count < locations.length; count++) {
  21. marker = new google.maps.Marker({
  22. position: new google.maps.LatLng(locations[count][1], locations[count][2]),
  23. map: map,
  24. title: document.currentScript.getAttribute('one')
  25. });
  26. google.maps.event.addListener(marker, 'click', (function (marker, count) {
  27. return function () {
  28. infowindow.setContent(document.currentScript.getAttribute('one'));
  29. infowindow.open(map, marker);
  30. }
  31. })(marker, count));
  32. }
  33. }
  34.  
  35. var params = document.body.getElementsByTagName('script');
  36. query = params[0].classList;
  37.  
  38. var locations = [
  39. ['hwlo', query[0], query[1]],
  40. ['hwlo', query[2], query[3]],
  41. ['hwlo', query[4], query[5]],
  42. ];
  43.  
  44. var locations = [
  45. ['hwlo', query[0], query[1]],
  46. ['hwlo', query[2], query[3]],
  47. ['hwlo', query[4], query[5]],
  48. ];
  49.  
  50. var locations = [];
  51. for (i = 0; i < query.length; i = i + 2) {
  52. locations.push([
  53. 'hwlo', query[i], query[i + 1]
  54. ]);
  55. }
Add Comment
Please, Sign In to add comment