How to add a bounds object InfoWindow and marker 2?

Hello! I need to displayed on the map 2 marker + InfoWindow open on one of them. Now to search for bounds try to use the code:
function calculateWaypointsBounds(attraction, destination, client, infoBox, map){

 const bounds = new google.maps.LatLngBounds();
 bounds.extend(new google.maps.LatLng(attraction.lat attraction.lon));
 bounds.extend(new google.maps.LatLng(client.lat, client.lon));
 bounds.extend(new google.maps.LatLng(destination.lat, destination.lon));

 const div = infoBox.content_;

 const projectionCoords = infoBox.getProjection().fromLatLngToContainerPixel(new google.maps.LatLng(attraction.lat attraction.lon));
 const leftTop = new google.maps.Point(projectionCoords.x - div.offsetWidth / 2, projectionCoords.y - 400);
 const rightTop = new google.maps.Point(projectionCoords.x + div.offsetWidth / 2, projectionCoords.y - 400);
 const ltCoords = infoBox.getProjection().fromContainerPixelToLatLng(leftTop);
 const rtCoords = infoBox.getProjection().fromContainerPixelToLatLng(rightTop);

bounds.extend(ltCoords);
 bounds.extend(rtCoords); //InfoWindow always shows above the marker, so I'm need only top left and top right corners.

 return bounds;
}


But something to determine the coordinates of the right and left corner of the InfoWindow does not work.
July 8th 19 at 15:48
0 answer

Find more questions by tags Google Maps