diff --git a/static/css/shared/_tiles.scss b/static/css/shared/_tiles.scss index 77500873b8..091a292191 100644 --- a/static/css/shared/_tiles.scss +++ b/static/css/shared/_tiles.scss @@ -342,7 +342,7 @@ $box-shadow-8dp: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, } } -#map-container { +.map-container { height: 100%; min-height: 200px; } diff --git a/static/js/components/google_map.tsx b/static/js/components/google_map.tsx index 5cfcdfea43..f078b6f125 100644 --- a/static/js/components/google_map.tsx +++ b/static/js/components/google_map.tsx @@ -96,16 +96,10 @@ function drawKmlCoordinates( // Adjust map bounds const sw = new google.maps.LatLng(mapInfo.down, mapInfo.left); const ne = new google.maps.LatLng(mapInfo.up, mapInfo.right); - const bounds = new google.maps.LatLngBounds(); - bounds.extend(sw); - bounds.extend(ne); - - // add listener to set bounds after map finishes loading. - // fitting bounds needs to be called after map finishes loading - // otherwise, the map will zoom all the way out to earth. - map.addListener("idle", () => { - map.fitBounds(bounds, MAP_BOUNDS_PADDING); - }); + let bounds = new google.maps.LatLngBounds(); + bounds = bounds.extend(sw); + bounds = bounds.extend(ne); + map.fitBounds(bounds, MAP_BOUNDS_PADDING); // Add polygons if (mapInfo.coordinateSequenceSet) {