diff --git a/src/scripts/components/globe/globe.tsx b/src/scripts/components/globe/globe.tsx index 1299f808e..4a675a1d3 100644 --- a/src/scripts/components/globe/globe.tsx +++ b/src/scripts/components/globe/globe.tsx @@ -48,6 +48,7 @@ interface Props { active: boolean; layer: LayerListItem | null; isMain?: boolean; + layerType?: string; view: GlobeView; projection: GlobeProjection; imageUrl: string | null; @@ -63,6 +64,7 @@ const Globe: FunctionComponent = ({ imageUrl, active, layer, + layerType, isMain, flyTo, onMouseEnter, @@ -180,9 +182,15 @@ const Globe: FunctionComponent = ({ const url = imageUrl; const layers = viewer.scene.imageryLayers; const oldLayer = layers.length > 1 && layers.get(1); - if (url) { - const imageProvider = new Cesium.SingleTileImageryProvider({url}); + const imageProvider = + layerType === 'tiles' + ? window.Cesium.createTileMapServiceImageryProvider({ + url + }) + : new Cesium.SingleTileImageryProvider({url}); + // @ts-ignore + window.imageryProvider = imageProvider; imageProvider.readyPromise.then(() => { viewer.scene.imageryLayers.addImageryProvider(imageProvider); // remove and destroy old layer if exists @@ -194,7 +202,7 @@ const Globe: FunctionComponent = ({ // remove old layer when no image should be shown anymore layers.remove(oldLayer, true); } - }, [viewer, imageUrl]); + }, [layerType, viewer, imageUrl]); // fly to location useEffect(() => { diff --git a/src/scripts/components/globes/globes.tsx b/src/scripts/components/globes/globes.tsx index d7fd17986..85403440d 100644 --- a/src/scripts/components/globes/globes.tsx +++ b/src/scripts/components/globes/globes.tsx @@ -79,6 +79,7 @@ const Globes: FunctionComponent = () => { layer={main} active={isMainActive} isMain + layerType={mainLayerDetails?.type} view={currentView} projection={projection} imageUrl={mainImageUrl} @@ -92,6 +93,7 @@ const Globes: FunctionComponent = () => { 0; i--) { const layerTime = Number(new Date(timestamps[i])); if (sliderTime > layerTime) { - time = layerTime; + index = i; break; } } - return time; + return index; } diff --git a/src/scripts/types/layer.d.ts b/src/scripts/types/layer.d.ts index 3c0f180e1..2d521723f 100644 --- a/src/scripts/types/layer.d.ts +++ b/src/scripts/types/layer.d.ts @@ -1,5 +1,6 @@ export interface Layer { id: string; + type: 'image' | 'tiles'; timestamps: string[]; // ISO 8601 timestamps timeFormat: { year?: 'numeric' | '2-digit'; diff --git a/storage/layers/analysed_sst/metadata.json b/storage/layers/analysed_sst/metadata.json new file mode 100644 index 000000000..c6239d2e8 --- /dev/null +++ b/storage/layers/analysed_sst/metadata.json @@ -0,0 +1,56 @@ +{ + "id": "analysed_sst", + "type": "tiles", + "timeFormat": { + "year": "2-digit", + "month": "numeric", + "day": "numeric" + }, + "timestamps": [ + "2009-01-05T00:00:00Z", + "2009-01-13T00:00:00Z", + "2009-01-21T00:00:00Z", + "2009-01-29T00:00:00Z", + "2009-02-06T00:00:00Z", + "2009-02-14T00:00:00Z", + "2009-02-22T00:00:00Z", + "2009-03-02T00:00:00Z", + "2009-03-10T00:00:00Z", + "2009-03-18T00:00:00Z", + "2009-03-26T00:00:00Z", + "2009-04-03T00:00:00Z", + "2009-04-11T00:00:00Z", + "2009-04-19T00:00:00Z", + "2009-04-27T00:00:00Z", + "2009-05-05T00:00:00Z", + "2009-05-13T00:00:00Z", + "2009-05-21T00:00:00Z", + "2009-05-29T00:00:00Z", + "2009-06-06T00:00:00Z", + "2009-06-14T00:00:00Z", + "2009-06-22T00:00:00Z", + "2009-06-30T00:00:00Z", + "2009-07-08T00:00:00Z", + "2009-07-16T00:00:00Z", + "2009-07-24T00:00:00Z", + "2009-08-01T00:00:00Z", + "2009-08-09T00:00:00Z", + "2009-08-17T00:00:00Z", + "2009-08-25T00:00:00Z", + "2009-09-02T00:00:00Z", + "2009-09-10T00:00:00Z", + "2009-09-18T00:00:00Z", + "2009-09-26T00:00:00Z", + "2009-10-04T00:00:00Z", + "2009-10-12T00:00:00Z", + "2009-10-20T00:00:00Z", + "2009-10-28T00:00:00Z", + "2009-11-05T00:00:00Z", + "2009-11-13T00:00:00Z", + "2009-11-21T00:00:00Z", + "2009-11-29T00:00:00Z", + "2009-12-07T00:00:00Z", + "2009-12-15T00:00:00Z", + "2009-12-23T00:00:00Z" + ] +} diff --git a/storage/layers/layers-de.json b/storage/layers/layers-de.json index 03f2f7615..5b32f3433 100644 --- a/storage/layers/layers-de.json +++ b/storage/layers/layers-de.json @@ -27,10 +27,157 @@ "subLayers": [] }, { - "id": "layer3", - "name": "Layer 3", + "id": "analysed_sst", + "name": "Analysierte SST", "description": "Das ist der dritte Layer", "link": "http://...", "subLayers": [] + }, + { + "id": "aerosol", + "name": "Aerosol", + "description": "Das ist der Aerosol Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "ais", + "name": "Antarktische Eisdecke", + "description": "Das ist der Antarctic Ice Sheet Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "biomass", + "name": "Biomasse", + "description": "Das ist der dritte Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "fire", + "name": "Feuer", + "description": "Das ist der Fire Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "glaciers", + "name": "Gletscher", + "description": "Das ist der Glaciers Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "greenhouseGases", + "name": "Treibhausgase", + "description": " Das ist der Greenhouse Gases Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "gis", + "name": "Grönland Eisdecke", + "description": "Das ist der Greenland Ice Sheet Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "hrl", + "name": "HR Landabdeckung", + "description": "Das ist der Greenhouse Gases Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "lakes", + "name": "Seen", + "description": "Das ist der Lakes Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "landCover", + "name": "Landabdeckung", + "description": "Das ist der Land Cover Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "lst", + "name": "Temperatur der Landoberfläche", + "description": "Das ist der Land Surface Temperature Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "oceanColour", + "name": "Ozeanfarbe", + "description": "Das ist der Ocean Colour Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "ozone", + "name": "Ozon", + "description": "Das ist der Ozone Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "permafrost", + "name": "Permafrost", + "description": "Das ist der Permafrost Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaIce", + "name": "Meereis", + "description": "Das ist der Sea Ice Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaLevel", + "name": "Meeresspiegel", + "description": "Das ist der Sea Level Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaState", + "name": "Seegang", + "description": "Das ist der Sea State Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaSurfaceSalinity", + "name": "Salzgehalt der Meeresoberfläche", + "description": "Das ist der Sea Surface Salinity Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "snow", + "name": "Schnee", + "description": "Das ist der Snow Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "soilMoisture", + "name": "Bodenfeuchtigkeit", + "description": "Das ist der Soil Moisture Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "waterVapour", + "name": "Wasserdampf", + "description": "Das ist der Water Vapour Layer", + "link": "http://...", + "subLayers": [] } ] diff --git a/storage/layers/layers-en.json b/storage/layers/layers-en.json index f811c2db7..79e74640a 100644 --- a/storage/layers/layers-en.json +++ b/storage/layers/layers-en.json @@ -1,35 +1,175 @@ [ { "id": "layer1", - "name": "Layer 1", - "description": "This is the first layer", + "name": "Layer 1 EN", + "description": "This is the first Layer", "link": "http://...", "subLayers": [ { "id": "layer1a", - "name": "Layer 1ab", - "description": "This is the first sublayer", + "name": "Layer 1a EN", + "description": "This is the first SubLayer", "link": "http://..." }, { "name": "SST", "id": "sst", - "description": "This is the first sublayer", + "description": "This is the second SubLayer", "link": "http://..." } ] }, { "id": "clouds", - "name": "Clouds Concentration", - "description": "This is the second layer", + "name": "Cloud Concentration", + "description": "This is the second SubLayer", "link": "http://...", "subLayers": [] }, { - "id": "layer3", - "name": "Layer 3", - "description": "This is the third layer", + "id": "analysed_sst", + "name": "Analysed SST", + "description": "This is the third Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "aerosol", + "name": "Aerosol", + "description": "This is the Aerosol Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "ais", + "name": "Antarctic Ice Sheet", + "description": "This is the Antarctic Ice Sheet Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "biomass", + "name": "Biomass", + "description": "This is the dritte Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "fire", + "name": "Fire", + "description": "This is the Fire Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "greenhouseGases", + "name": "Greenhouse Gases", + "description": "This is the Greenhouse Gases Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "gis", + "name": "Greenland Ice Sheet", + "description": "This is the Greenland Ice Sheet Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "hrl", + "name": "HR Landcover", + "description": "This is the Greenhouse Gases Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "lakes", + "name": "Lakes", + "description": "This is the Lakes Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "landCover", + "name": "Land Cover", + "description": "This is the Land Cover Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "lst", + "name": "Land Surface Temperature", + "description": "This is the Land Surface Temperature Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "oceanColour", + "name": "Ocean Colour", + "description": "This is the Ocean Colour Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "ozone", + "name": "Ozone", + "description": "This is the Ozone Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "permafrost", + "name": "Permafrost", + "description": "This is the Permafrost Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaIce", + "name": "Sea Ice", + "description": "This is the Sea Ice Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaLevel", + "name": "Sea Level", + "description": "This is the Sea Level Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaState", + "name": "Sea State", + "description": "This is the Sea State Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "seaSurfaceSalinity", + "name": "Sea Surface Salinity", + "description": "This is the Sea Surface Salinity Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "snow", + "name": "Snow", + "description": "This is the Snow Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "soilMoisture", + "name": "Soil Moisture", + "description": "This is the Soil Moisture Layer", + "link": "http://...", + "subLayers": [] + }, + { + "id": "waterVapour", + "name": "Water Vapour", + "description": "This is the Water Vapour Layer", "link": "http://...", "subLayers": [] } diff --git a/storage/layers/layers-es.json b/storage/layers/layers-es.json deleted file mode 100644 index 03f2f7615..000000000 --- a/storage/layers/layers-es.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "id": "layer1", - "name": "Layer 1 DE", - "description": "Das ist der erste Layer", - "link": "http://...", - "subLayers": [ - { - "id": "layer1a", - "name": "Layer 1a DE", - "description": "Das ist der erste SubLayer", - "link": "http://..." - }, - { - "name": "SST De", - "id": "sst", - "description": "Das ist der zweite SubLayer", - "link": "http://..." - } - ] - }, - { - "id": "clouds", - "name": "Wolken Konzentration", - "description": "Das ist der zweite SubLayer", - "link": "http://...", - "subLayers": [] - }, - { - "id": "layer3", - "name": "Layer 3", - "description": "Das ist der dritte Layer", - "link": "http://...", - "subLayers": [] - } -] diff --git a/storage/stories/stories-en.json b/storage/stories/stories-en.json index d06472231..faf804f50 100644 --- a/storage/stories/stories-en.json +++ b/storage/stories/stories-en.json @@ -3,7 +3,7 @@ "id": "story1", "title": "Planetary Heat Store", "description": "", - "image": "https://storage.googleapis.com/esa-cfs-storage/stories/story1/assets/story1.jpeg" + "image": "https://storage.googleapis.com/esa-cfs-storage/stories/story1/assets/sst_large_18.jpg" }, { "id": "story2",