Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. function initMap() {
  2. mapDiv = document.getElementById('map');
  3. map = new google.maps.Map(mapDiv, {
  4. center: {lat: 51.9960464, lng: 5.8911804},
  5. zoom: 13,
  6. disableDefaultUI: true
  7. });
  8. var i;
  9. var location_halflength = Math.floor(locations.length / 2);
  10. for(i=0; i < locations.length; i++){
  11. marker = new google.maps.Marker({
  12. position: {lat: locations[i][1], lng: locations[i][2]},
  13. map: map,
  14. animation: google.maps.Animation.DROP,
  15. title: locations[i][0]
  16. });
  17.  
  18. locations[i][3] = marker;
  19.  
  20. if(i == 0){
  21. $("div.dropdown-locaties").append('' +
  22. '<ul class="dropdown-locaties-ul">');
  23. }
  24.  
  25. if(i >= 0 && i <= location_halflength){
  26. $("ul.dropdown-locaties-ul").append('' +
  27. '<li onclick="setPos(' + locations[i][1] + ', '+ locations[i][2] +'); slideUp(\'.dropdown-locaties\'); setZoom(15)"><span>'+locations[i][0]+'</span></li>');
  28. }
  29.  
  30. if(i == location_halflength){
  31. $("div.dropdown-locaties").append('' +
  32. '</ul>\n' +
  33. '<ul class="dropdown-locaties-ul">');
  34. }
  35.  
  36. if(i > location_halflength){
  37. $("ul.dropdown-locaties-ul").next().append('' +
  38. '<li onclick="setPos(' + locations[i][1] + ', '+ locations[i][2] +'); slideUp(\'.dropdown-locaties\'); setZoom(15)"><span>'+locations[i][0]+'</span></li>');
  39. }
  40.  
  41. if(i == locations.length){
  42. $("div.dropdown-locaties").append('' +
  43. '</ul>');
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement