Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update layers and zoom #680

Merged
merged 2 commits into from
May 28, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function CountryEntryTooltipComponent({
content: tooltipref.current,
});

view.popup.reposition();
// view.popup?.reposition();
if (view.camera) {
const camera = view.camera.clone();
camera.position.latitude += 5;
Expand Down
32 changes: 0 additions & 32 deletions src/constants/biodiversity-layers-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ import {
TREES_RICHNESS,
HUMMINGBIRDS_RARITY,
HUMMINGBIRDS_RICHNESS,
BIRDS_SACA_RARITY_TOTAL,
BIRDS_SACA_RICHNESS_TOTAL,
MAMMALS_SACA_RARITY_TOTAL,
MAMMALS_SACA_RICHNESS_TOTAL,
} from 'constants/layers-slugs';

export const LAYER_VARIANTS = {
Expand Down Expand Up @@ -343,20 +339,6 @@ export const getLayersToggleConfig = () => ({
layer: DRAGONFLIES_RICHNESS_1KM,
group: t('invertebrates'),
},
{
value: BIRDS_SACA_RICHNESS_TOTAL,
name: t('birds - Central & South America'),
title: t('birds - Central & South America'),
layer: BIRDS_SACA_RICHNESS_TOTAL,
group: t('birds'),
},
{
value: MAMMALS_SACA_RICHNESS_TOTAL,
name: t('mammals - Central & South America'),
title: t('mammals - Central & South America'),
layer: MAMMALS_SACA_RICHNESS_TOTAL,
group: t('mammals'),
},
{
value: HUMMINGBIRDS_RICHNESS,
name: t('hummingbirds'),
Expand Down Expand Up @@ -588,20 +570,6 @@ export const getLayersToggleConfig = () => ({
layer: RESIDENT_BIRDS_RARITY_1KM,
group: t('birds'),
},
{
value: BIRDS_SACA_RARITY_TOTAL,
name: t('birds - Central & South America'),
title: t('birds - Central & South America'),
layer: BIRDS_SACA_RARITY_TOTAL,
group: t('birds'),
},
{
value: MAMMALS_SACA_RARITY_TOTAL,
name: t('mammals - Central & South America'),
title: t('mammals - Central & South America'),
layer: MAMMALS_SACA_RARITY_TOTAL,
group: t('mammals'),
},
{
value: SUMMER_BIRDS_RARITY_1KM,
name: t('summer birds'),
Expand Down
20 changes: 4 additions & 16 deletions src/constants/layers-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ import {
TREES_PRIORITY,
TREES_RICHNESS,
TREES_RARITY,
BIRDS_SACA_RARITY_TOTAL,
MAMMALS_SACA_RICHNESS_TOTAL,
MAMMALS_SACA_RARITY_TOTAL,
BIRDS_SACA_RICHNESS_TOTAL,
} from 'constants/layers-slugs';

const { REACT_APP_VERCEL_ENV } = process.env;
Expand Down Expand Up @@ -258,11 +254,13 @@ export const LAYERS_URLS = {
[BIRDS_RARITY_1KM]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/birds_rar_sa_tif/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SEA_Birds_Rarity_v1_5_1_20240313/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Birds_Log_Total_Rarity/MapServer',
],
// South Africa, South East Asia
[BIRDS_RICHNESS_1KM]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/birds_rich_sa_tif/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SEA_Birds_Richness_v1_5_1_20240313/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/NASA_Birds_Richness/MapServer',
],
[RESTIO_RARITY_1KM]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/restio_rar_sa_tif/MapServer',
Expand All @@ -284,25 +282,15 @@ export const LAYERS_URLS = {
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Richness_Patterns_for_Reptile_Species/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SEA_Reptiles_Richness_v1_5_1_20240313/MapServer',
],
[MAMMALS_SACA_RICHNESS_TOTAL]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SACA_Mammals_Richness/MapServer',
[MAMMALS_SACA_RARITY_TOTAL]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SACA_Mammals_Log_Mean_Rarity/MapServer',
],
[BIRDS_SACA_RARITY_TOTAL]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SACA_Birds_Log_Mean_Rarity/MapServer',
],
[BIRDS_SACA_RICHNESS_TOTAL]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SACA_Birds_Richness/MapServer',
[HUMMINGBIRDS_RARITY]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/hb_rarity_raw_tif/MapServer',
[HUMMINGBIRDS_RICHNESS]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/hb_rich_1km_tif/MapServer',
// US, South Africa, South East Asia
[MAMMALS_RICHNESS_1KM]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/mamm_rich_sa_tif/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Richness_Patterns_for_Mammal_Species_of_North_America/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SEA_Mammals_Richness_v1_5_20240313/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/NASA_Mammals_Richness/MapServer',
],
[SUMMER_BIRDS_RICHNESS_1KM]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Richness_Patterns_of_Breeding_Bird_Species_of_North_America/MapServer',
Expand All @@ -314,9 +302,9 @@ export const LAYERS_URLS = {
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/NA_Ants_richness_v2_tif/MapServer',
// US, South Africa, South East Asia
[MAMMALS_RARITY_1KM]: [
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Rarity_Patterns_for_Mammal_Species_of_North_America/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/mamm_rar_sa_tif/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/SEA_Mammals_Rarity_v1_5_20240313/MapServer',
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/NASA_Mammals_Log_Total_Rarity/MapServer',
],
[SUMMER_BIRDS_RARITY_1KM]:
'https://tiles.arcgis.com/tiles/IkktFdUAcY3WrH25/arcgis/rest/services/Rarity_Patterns_for_Breeding_Bird_Species_of_North_America/MapServer',
Expand Down
8 changes: 4 additions & 4 deletions src/constants/mol-layers-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export const LAYERS_CATEGORIES = {
MARINE_HUMAN_PRESSURES: 'Marine use pressures',
};

const USCenteredBbox = [-176.3, 20.2, -46.3, 75.2];
const USCenteredBbox = [-146.3, 10.2, -20.3, 45.2];
const AmericaCenteredBbox = [-237.28, -59.58, 77.01, 66.81];
const SouthAfricaAndSouthEastAsiaBbox = [60.2, -20, 151, 38.1];
// const SouthAfricaAndSouthEastAsiaBbox = [60.2, -20, 151, 38.1];

export const layersConfig = {
[PLEDGES_LAYER]: {
Expand Down Expand Up @@ -448,14 +448,14 @@ export const layersConfig = {
slug: BIRDS_RARITY_1KM,
type: LAYER_TYPES.TILE_LAYER,
url: LAYERS_URLS[BIRDS_RARITY_1KM],
bbox: SouthAfricaAndSouthEastAsiaBbox,
bbox: USCenteredBbox,
},
[BIRDS_RICHNESS_1KM]: {
title: BIRDS_RICHNESS_1KM,
slug: BIRDS_RICHNESS_1KM,
type: LAYER_TYPES.TILE_LAYER,
url: LAYERS_URLS[BIRDS_RICHNESS_1KM],
bbox: SouthAfricaAndSouthEastAsiaBbox,
bbox: USCenteredBbox,
},
[RESTIO_RARITY_1KM]: {
title: RESTIO_RARITY_1KM,
Expand Down