var map; var windfarms = { 80 : { lat : 56.0693, long : -4.1489, name : "Shelloch", status : 'Approved by Stirling Council in 2022', url : '/projects/completed/shelloch/', zoom : 6 }, }; markMap = function (windfarm) { var url = location.href; var image = new google.maps.MarkerImage( '/assets/img/ui/marker.png', new google.maps.Size(37,38), new google.maps.Point(0,0), new google.maps.Point(19,38) ); var shadow = new google.maps.MarkerImage( '/assets/img/ui/shadow.png', new google.maps.Size(59,38), new google.maps.Point(0,0), new google.maps.Point(19,38) ); var shape = { coord: [36,0,36,1,36,2,36,3,36,4,36,5,36,6,36,7,36,8,36,9,36,10,36,11,36,12,36,13,36,14,36,15,36,16,36,17,36,18,36,19,36,20,36,21,36,22,36,23,24,24,24,25,23,26,23,27,23,28,22,29,22,30,21,31,21,32,21,33,20,34,20,35,19,36,19,37,17,37,17,36,16,35,16,34,15,33,15,32,15,31,14,30,14,29,13,28,13,27,13,26,12,25,12,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0,0,36,0], type: 'poly' }; var marker = new google.maps.Marker({ draggable: false, raiseOnDrag: false, icon: image, shadow: shadow, shape: shape, map: map, position: new google.maps.LatLng(windfarm.lat, windfarm.long) }); var myInfoWindowOptions = { content: '

' + windfarm.name + '

' + windfarm.status + '

view project

', maxWidth: 275 }; var infoWindow = new google.maps.InfoWindow(myInfoWindowOptions); google.maps.event.addListener(marker, 'click', function() { infoWindow.open(map,this); }); google.maps.event.addListener(marker, 'dragstart', function(){ infoWindow.close(); }); } loadMap = function (el, centerLat, centerLong, zoom) { zoom = typeof zoom != 'undefined' ? zoom : 6; var myMapOptions = { zoom: zoom, center: new google.maps.LatLng(centerLat,centerLong), streetViewControl: false, scaleControl: false, mapTypeId: google.maps.MapTypeId.TERRAIN, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU } }; map = new google.maps.Map(document.getElementById(el),myMapOptions); } if($('#map').length){ loadMap("map",56.0693,-4.1489); for(var i in windfarms){ markMap(windfarms[i]); } }