Customize Google maps infowindow

0

Is it possible to customize the marker infowindow in the Google Maps API by placing buttons and more than one row of information?

    
asked by anonymous 25.03.2016 / 16:53

1 answer

0

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);
        });
    
18.05.2016 / 16:17