I can implement a google marker, and also be able to implement a link in the marker, when the user clicks on the marker it is automatically directed to another page, the only problem that when the user clicks on the marker is the component that goes be directed to another page and not the site that goes to another page, note the two figures below;
Figure 1.
Figure2.
Sohowcanyouseewhentheuserclicksthebookmarkinsteadofthewholepagebeingrenderedtoanotherpageitonlyrenderstheinternalcomponent.
IsthereanywayintheJavascriptcodetobeabletorenderthewholepagetobedirectedtoanotherpageinsteadoftheinternalcomponent?
Here'smycode:
<!DOCTYPEhtml><html><head><metaname="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZBoBe3ObpfsAiLNq2aByZXKp4XRlUPYE"type="text/javascript"></script>
</head>
<body>
<script>
function initialize() {
var myLatLng = {lat: -23.6336946, lng: -46.73667330000001};
var mapOptions = {
zoom:15,
center:myLatLng
}
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'MDW Outsoucing Consultoria'
});
/*
var beachMarker = new google.maps.Marker({
position: {lat: -27.6041949, lng: -48.466012},
map: map,
icon: image
});
*/
marker.addListener('click', function() {
window.location = 'https://www.mdwoutsourcing.com.br/quem-somos';
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map"></div>
</body>
</html>