Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/OpenLayersMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function OpenLayersMap({
resolutions: getBaselayerResolutions(
b.extent[2] - b.extent[0],
256,
9
b.maxZoom
),
origin: [b.extent[0], b.extent[3]],
}),
Expand Down
14 changes: 14 additions & 0 deletions src/configs/mapSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ export const EXTERNAL_BASELAYERS: ExternalBaselayer[] = [
'EPSG:4326',
'EPSG:3857'
),
maxZoom: 8,
disabledState: (isFlipped: boolean) => !isFlipped,
},
{
id: 'external-unwise-neo6',
name: 'Legacy Survey | unWISE neo6',
projection: 'EPSG:3857',
url: 'https://s3.us-west-2.amazonaws.com/unwise-neo6.legacysurvey.org/{z}/{x}/{y}.jpg',
extent: transformExtent(
[-180, -MERCATOR_MAX_LAT, 180, MERCATOR_MAX_LAT],
'EPSG:4326',
'EPSG:3857'
),
maxZoom: 10,
disabledState: (isFlipped: boolean) => !isFlipped,
},
];
Expand Down
1 change: 1 addition & 0 deletions src/types/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export type ExternalBaselayer = {
projection: string;
url: string | TileUrlFunction;
extent: number[];
maxZoom: number;
disabledState: (state: boolean) => boolean;
};

Expand Down
2 changes: 1 addition & 1 deletion src/utils/layerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function getBaselayerResolutions(
) {
const resolutionZ0 = worldWidth / tileSize;
const resolutions = [];
for (let i = 0; i < maxZoom; i++) {
for (let i = 0; i <= maxZoom; i++) {
resolutions.push(resolutionZ0 / 2 ** i);
}
return resolutions;
Expand Down