<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=AIzaSyAJKHmMyUkGyvinWnKpHqlF6OF-e0KYHTo&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: 12,
zoomControl: true,
mapTypeId: 'roadmap',
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT,
},
disableDoubleClickZoom: true,
mapTypeControl: false,
scaleControl: true,
scrollwheel: false,
panControl: true,
streetViewControl: true,
draggable: true,
overviewMapControl: true,
overviewMapControlOptions: {
opened: false,
},
styles: [
{
"featureType": "administrative",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#444444"
}
]
},
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{
"color": "#f2f2f2"
}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "all",
"stylers": [
{
"saturation": -100
},
{
"lightness": 45
}
]
},
{
"featureType": "road.highway",
"elementType": "all",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "road.arterial",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"elementType": "all",
"stylers": [
{
"color": "#ec3f92"
},
{
"visibility": "on"
}
]
}
]
}
var mapElement = document.getElementById('map');
var map = new google.maps.Map(mapElement, mapOptions);
var locations = [
[
'{{ sitename }}',
`{{ renderSetting(1, 'content') }}`,
'{{ renderSetting(2, 'content') }} or {{ renderSetting(15, '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: "",
scaledSize: new google.maps.Size(80, 80)
};
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>