// Google Maps //
function initMap() {
var myLatLng = {lat: 54.5793765, lng: -1.2309298};
var image = {
url: 'https://www.newwavedigital.co.uk/assets/img/map-pin.png',
// This marker is 20 pixels wide by 32 pixels high.
size: new google.maps.Size(247, 247),
// The origin for this image is (0, 0).
origin: new google.maps.Point(0, 0),
clickable: "yes",
// The anchor for this image is the base of the flagpole at (0, 32).
anchor: new google.maps.Point(125, 157)
};
// Create an array of styles.
var styles = [
{
stylers: [
{hue: "#0d1725"},
{saturation: 75}
]
}, {
featureType: "road",
elementType: "geometry",
stylers: [
{lightness: 0},
{visibility: "simplified"}
]
}, {
featureType: "road",
elementType: "labels",
stylers: [
{visibility: "on"}
]
}
];
// Create a new StyledMapType object, passing it the array of styles,
// as well as the name to be displayed on the map type control.
var styledMap = new google.maps.StyledMapType(styles,
{name: "New Wave Digital"});
// Create a map object, and include the MapTypeId to add
// to the map type control.
var mapOptions = {
zoom: 15,
draggable: false,
scrollwheel: false,
center: myLatLng,
disableDefaultUI: false,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'style']
}
};
var map = new google.maps.Map(document.getElementById('map'),
mapOptions);
//Associate the styled map with the MapTypeId and set it to display.
map.mapTypes.set('style', styledMap);
map.setMapTypeId('style');
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image
});
marker.addListener('click', function () {
window.open('https://www.google.co.uk/maps/place/New+Wave+Digital/@54.5793011,-1.2333027,17z/data=!3m1!4b1!4m2!3m1!1s0x487e709527205deb:0x9d56bda382e1d60d', '_blank');
});
google.maps.event.addDomListener(window, 'resize', function () {
map.panTo(myLatLng);
});
}
// Google Maps //