How to get information from a Google Maps InfoWindow?

0

I want to get the values entered by the user in the input of InfoWindow of Google Maps, is there any way to do it or will I have to remove them from there and put them somewhere else?

This is the code you use to add the bookmark:

function addMarker(location) 
{
    var marker = new google.maps.Marker(
    {
      position: location,
      map: map
    });
  var contentString = "<div align = 'center'><br><label>Time at you pass: </label><br><input type='text'><br><br><label>Price of this spot: </label><br><input type='text'><div class='buttons'><button class='buttonOK' onClick=addTravel()>Save</button></div></div>'";
    console.log(contentString);
    var infowindow = new google.maps.InfoWindow({
            content: contentString
        });

    marker.addListener('click', function() {
          infowindow.open(map, marker);
        });
}
    
asked by Thunder 18.02.2018 в 22:41
source

0 answers