Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initMap() {
- mapDiv = document.getElementById('map');
- map = new google.maps.Map(mapDiv, {
- center: {lat: 51.9960464, lng: 5.8911804},
- zoom: 13,
- disableDefaultUI: true
- });
- var i;
- var location_halflength = Math.floor(locations.length / 2);
- for(i=0; i < locations.length; i++){
- marker = new google.maps.Marker({
- position: {lat: locations[i][1], lng: locations[i][2]},
- map: map,
- animation: google.maps.Animation.DROP,
- title: locations[i][0]
- });
- locations[i][3] = marker;
- if(i == 0){
- $("div.dropdown-locaties").append('' +
- '<ul class="dropdown-locaties-ul">');
- }
- if(i >= 0 && i <= location_halflength){
- $("ul.dropdown-locaties-ul").append('' +
- '<li onclick="setPos(' + locations[i][1] + ', '+ locations[i][2] +'); slideUp(\'.dropdown-locaties\'); setZoom(15)"><span>'+locations[i][0]+'</span></li>');
- }
- if(i == location_halflength){
- $("div.dropdown-locaties").append('' +
- '</ul>\n' +
- '<ul class="dropdown-locaties-ul">');
- }
- if(i > location_halflength){
- $("ul.dropdown-locaties-ul").next().append('' +
- '<li onclick="setPos(' + locations[i][1] + ', '+ locations[i][2] +'); slideUp(\'.dropdown-locaties\'); setZoom(15)"><span>'+locations[i][0]+'</span></li>');
- }
- if(i == locations.length){
- $("div.dropdown-locaties").append('' +
- '</ul>');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement