<div id="map"></div>
{# Do not use this API key for production sites - Generate a new key and allow the LIVE and DEV domains #}
{# Get a new API key here: https://developers.google.com/maps/documentation/javascript/get-api-key #}
<script async
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAFQr5-BviDSycw3hxKecYJoCsTet11WlQ&loading=async&callback=initMap">
</script>
<script type="text/javascript">
var map;
function initMap() {
var mapOptions = {
center: new google.maps.LatLng({{ renderSetting(4, 'content') }},{{ renderSetting(5, 'content') }}),
zoom: 14,
zoomControl: false,
mapTypeId: 'hybrid',
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT,
},
disableDoubleClickZoom: true,
mapTypeControl: false,
scaleControl: false,
scrollwheel: false,
cameraControl: false,
streetViewControl: false,
fullscreenControl: false,
draggable: true,
overviewMapControl: false,
overviewMapControlOptions: {
opened: false,
},
styles: [],
}
var mapElement = document.getElementById('map');
var map = new google.maps.Map(mapElement, mapOptions);
var locations = [
[
'{{ sitename }}',
`{{ renderSetting(1, 'content') }}`,
'{{ renderSetting(2, 'content') }}',
'{{ renderSetting(3, 'content') }}',
'{{ renderSetting(4, 'content') }}','{{ renderSetting(5, 'content') }}'
]
];
for (i = 0; i < locations.length; i++) {
if (locations[i][0] == 'undefined') { description = ''; } else {name = locations[i][0]; }
if (locations[i][1] == 'undefined') { description = ''; } else {description = locations[i][1]; }
if (locations[i][2] == 'undefined') { telephone = ''; } else { telephone = locations[i][2]; }
if (locations[i][3] == 'undefined') { email = ''; } else { email = locations[i][3]; }
var infoWindowContent = '<div id="maps-infowindow" class="leading-normal text-sm">'+
'<div class="mb-3"><strong>'+name+'</strong>'+'<br/>'+description+'</div>'+
'<div>'+telephone+'<br/>'+email+'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({content: infoWindowContent});
var markericon = {
url: "/images/map-pin.png",
scaledSize: new google.maps.Size(60, 60)
};
marker = new google.maps.Marker({
icon: markericon,
position: new google.maps.LatLng(locations[i][4], locations[i][5]),
map: map,
title: locations[i][0],
desc: description,
tel: telephone,
email: email
});
marker.addListener('click', function() { infowindow.open(map, marker); });
}
}
</script>