I have a map on my site, where the location of the establishment on the map has the logo, instead of the default Google Maps PIN, a PNG image appears.
I need this image, when clicking, to take a specific URL within the site itself. I already researched some codes, but it did not work.
Here is my code used on the site:
<script>
// This example adds a marker to indicate the position of Bondi Beach in Sydney,
// Australia.
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 18,
center: {lat: -27.6041949, lng: -48.466012}
});
var image = 'img/marcador.png';
var beachMarker = new google.maps.Marker({
position: {lat: -27.6041949, lng: -48.466012},
map: map,
icon: image
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AQUI_VAI_O_MEU_API_&signed_in=true&callback=initMap"></script>
<style>
#map {
height: 432px;
}
</style>
Thanks in advance for your cooperation!