diff --git a/packages/landing/src/components/map.tsx b/packages/landing/src/components/map.tsx index 67b722d67..6c5558304 100644 --- a/packages/landing/src/components/map.tsx +++ b/packages/landing/src/components/map.tsx @@ -49,27 +49,26 @@ export class Basemaps extends Component { - if (Config.map.tileMatrix !== GoogleTms) { - // Transform bounds to current tileMatrix - const lngLatBounds: maplibregl.LngLatBounds = maplibre.LngLatBounds.convert(bounds); - const upperLeft = lngLatBounds.getNorthEast(); - const lowerRight = lngLatBounds.getSouthWest(); - const zoom = this.map.getZoom(); - const upperLeftLocation = locationTransform( - { lat: upperLeft.lat, lon: upperLeft.lng, zoom }, - Config.map.tileMatrix, - GoogleTms, - ); - const lowerRightLocation = locationTransform( - { lat: lowerRight.lat, lon: lowerRight.lng, zoom }, - Config.map.tileMatrix, - GoogleTms, - ); - bounds = [ - [upperLeftLocation.lon, upperLeftLocation.lat], - [lowerRightLocation.lon, lowerRightLocation.lat], - ]; - } + // Transform bounds to current tileMatrix + const lngLatBounds: maplibregl.LngLatBounds = maplibre.LngLatBounds.convert(bounds); + const upperLeft = lngLatBounds.getNorthEast(); + const lowerRight = lngLatBounds.getSouthWest(); + const zoom = this.map.getZoom(); + const upperLeftLocation = locationTransform( + { lat: upperLeft.lat, lon: upperLeft.lng, zoom }, + Config.map.tileMatrix, + GoogleTms, + ); + const lowerRightLocation = locationTransform( + { lat: lowerRight.lat, lon: lowerRight.lng, zoom }, + Config.map.tileMatrix, + GoogleTms, + ); + bounds = [ + [upperLeftLocation.lon, upperLeftLocation.lat], + [lowerRightLocation.lon, lowerRightLocation.lat], + ]; + this.map.fitBounds(bounds); };