client/locations-list-map.js
// accepts a marker and zooms the map to that marker using our fitMapToMarkersNearBounds logic
accepts a marker and zooms the map to that marker using our fitMapToMarkersNearBounds logic
accepts a marker and zooms the map to that marker using our fitMapToMarkersNearBounds logic
function zoomToMarker(marker) {
  if (marker) {
    const bounds = new google.maps.LatLngBounds();
    bounds.extend(marker.position);
    fitMapToMarkersNearBounds(bounds);
    gMap.setCenter(marker.position);
  } else {
    console.log('no marker to zoom to');
  }
}
function zoomToMarker ( marker ) { if ( marker ) { const bounds = new google . maps . LatLngBounds ( ) ; bounds . extend ( marker . position ) ; fitMapToMarkersNearBounds ( bounds ) ; gMap . setCenter ( marker . position ) ; } else { console . log ( 'no marker to zoom to' ) ; } }
accepts a marker and zooms the map to that marker using our fitMapToMarkersNearBounds logic
accepts a marker and zooms the map to that marker using our fitMapToMarkersNearBounds logic
// we're getting a rough zoom calculation by using our existing fitMapToMarkersNearBounds // but ultimately centering on the marker that was clicked