Skip to content

Commit c0222f2

Browse files
committed
Max zoom capped at 8
1 parent 1067a95 commit c0222f2

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

Eplant/views/WorldEFP/MapContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const MapContainer = ({ activeData, state, setState }: MapContainerProps) => {
5050
<Map
5151
defaultCenter={state.position}
5252
defaultZoom={2}
53+
maxZoom={8}
5354
mapId={import.meta.env.VITE_MAP_ID}
5455
streetViewControl={false}
5556
mapTypeId={state.mapTypeId}

Eplant/views/WorldEFP/overlayTiles.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const BASE_PATH = '/temp_world_efp'
1313
* Builds a tileMap by constructing public URLs for all tiles in a grid up to maxZoom.
1414
* At each zoom level z the grid is 2^z x 2^z.
1515
*/
16-
function buildTileMap(dir: string, prefix: string, maxZoom: number): OverlayTileData {
16+
function buildTileMap(
17+
dir: string,
18+
prefix: string,
19+
maxZoom: number
20+
): OverlayTileData {
1721
const tileMap: TileMap = {}
1822
for (let zoom = 0; zoom <= maxZoom; zoom++) {
1923
const count = 1 << zoom
@@ -41,8 +45,9 @@ export async function fetchOverlayTiles(
4145
case OverlayType.Precipitation:
4246
return buildTileMap('AnnualPrecip', 'Annual_Precipitation', 2)
4347
case OverlayType.HistoricalMinTemp:
44-
return buildTileMap('HistMin', 'Historical_Min_Temp_of_coldest_Month', 2)
48+
// No tiles yet — empty map causes getTileUrl to fall back to placeholder
49+
return { tileMap: {}, maxZoom: 2 }
4550
case OverlayType.HistoricalMaxTemp:
46-
return buildTileMap('HistMax', 'Historical_Max_temp_of_warmest_month', 2)
51+
return { tileMap: {}, maxZoom: 2 }
4752
}
4853
}

0 commit comments

Comments
 (0)