function createMarkerForEdit(lat, lng) {
  // If we're already showing an editable marker, then remove it.
  if (editMarker) {
    editMarker.setMap(null);
  }
  
  editMarker =
      new google.maps.Marker({position: {lat: lat, lng: lng}, map: map});

  let infoWindow = new google.maps.InfoWindow({content:buildInfoWindowInput(lat, lng)});

  // When the user closes the editable info window, remove the marker.
  google.maps.event.addListener(infoWindow, 'closeclick', () => {
    editMarker.setMap(null);
  });

  infoWindow.open(map, editMarker);
}
/** Creates a marker that shows a textbox the user can edit. */
Creates a marker that shows a textbox the user can edit.
Creates a marker that shows a textbox the user can edit .
function createMarkerForEdit(lat, lng) {
  if (editMarker) {
    editMarker.setMap(null);
  }
  editMarker =
      new google.maps.Marker({position: {lat: lat, lng: lng}, map: map});
  let infoWindow = new google.maps.InfoWindow({content:buildInfoWindowInput(lat, lng)});
  google.maps.event.addListener(infoWindow, 'closeclick', () => {
    editMarker.setMap(null);
  });
  infoWindow.open(map, editMarker);
}
function createMarkerForEdit ( lat , lng ) { if ( editMarker ) { editMarker . setMap ( null ) ; } editMarker = new google . maps . Marker ( { position : { lat : lat , lng : lng } , map : map } ) ; let infoWindow = new google . maps . InfoWindow ( { content : buildInfoWindowInput ( lat , lng ) } ) ; google . maps . event . addListener ( infoWindow , 'closeclick' , ( ) => { editMarker . setMap ( null ) ; } ) ; infoWindow . open ( map , editMarker ) ; }
Creates a marker that shows a textbox the user can edit.
Creates a marker that shows a textbox the user can edit .
// If we're already showing an editable marker, then remove it. // When the user closes the editable info window, remove the marker.