Is it possible to customize the marker infowindow in the Google Maps API by placing buttons and more than one row of information?
Is it possible to customize the marker infowindow in the Google Maps API by placing buttons and more than one row of information?
Yes, in the example I have a title, description and button
var pointA = {lat: 37.138649, lng: -82.422405};
var contentString = '<div id="content">' +
'<div id="siteNotice">' +
'</div>' +
'<h2 id="firstHeading" class="firstHeading">Titulo_1</h2>' +
'<div id="bodyContent">' +
'<p><b>desciçãotitulo:</b> descrição1 ' +
'</div>' +
'<button onclick="myFunction()">Obter indicações</button>'
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: pointA,
map: map,
title: 'Titulo'
});
marker.addListener('click', function () {
infowindow.open(map, marker);
});