Skip to content

Commit 27b2371

Browse files
committed
updates
1 parent 65f6576 commit 27b2371

File tree

10 files changed

+111
-112
lines changed

10 files changed

+111
-112
lines changed

src/app/Services/API/Requests/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,4 +749,10 @@ export class RequestApi extends Http {
749749
};
750750

751751
public getForecastAttribute = (attribute, params = {}) => {};
752+
753+
public getAppVersion = () => {
754+
const ret = this.instance.get<any>(
755+
`${BACKEND_API_URL}/coverages/configuration-parameters?offset=0&limit=100`,
756+
);
757+
};
752758
}

src/app/components/Map/DynamicStationsLayer.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,28 @@ export const DynamicStationsLayer = (props: any) => {
3737
// @ts-ignore
3838
context.map.getPane('stationssel').style.zIndex = zIndex;
3939

40+
let ln = url.split('/')[4];
41+
42+
const vtlstyles = {};
43+
vtlstyles[ln] = (properties, zoom, geometryDimension) => {
44+
let opacity = 0.9;
45+
let color = data === 'future' ? '#abb2b9' : '#464b52';
46+
// console.log(zoom, color, opacity)
47+
return {
48+
color: color,
49+
weight: data === 'future' ? 2 : 4,
50+
radius: data === 'future' ? 5 : 10,
51+
fill: true,
52+
fillOpacity: 0.7,
53+
opacity: opacity,
54+
};
55+
};
56+
4057
// @ts-ignore
4158
let vectorLayer = L.vectorGrid.protobuf(url, {
4259
interactive: true,
4360
pane: 'stationssel',
44-
vectorTileLayerStyles: {
45-
stationssel: (properties, zoom, geometryDimension) => {
46-
let opacity = 0.9;
47-
let color = data === 'future' ? '#abb2b9' : '#464b52';
48-
// console.log(zoom, color, opacity)
49-
return {
50-
color: color,
51-
weight: data === 'future' ? 2 : 4,
52-
radius: data === 'future' ? 5 : 10,
53-
fill: true,
54-
fillOpacity: 0.7,
55-
opacity: opacity,
56-
};
57-
},
58-
},
61+
vectorTileLayerStyles: vtlstyles,
5962
});
6063

6164
context.map.addLayer(vectorLayer);
@@ -79,6 +82,8 @@ export const DynamicStationsLayer = (props: any) => {
7982
context.map,
8083
selectCallback,
8184
url,
85+
zIndex,
86+
data,
8287
]);
8388

8489
return (

src/app/components/Map/StationsLayer.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,8 @@ import { PopupStyle } from './styles';
1313

1414
export const StationsLayer = (props: any) => {
1515
const { selected_map } = useSelector((state: any) => state.map);
16-
const {
17-
selectCallback,
18-
selectedPoint,
19-
openCharts,
20-
zIndex,
21-
variable,
22-
data,
23-
url,
24-
} = props;
16+
const { selectCallback, selectedPoint, openCharts, zIndex, variable, data } =
17+
props;
2518
const map = useMap();
2619
const context = useLeafletContext();
2720
// console.log(context.map.latLngToLayerPoint(selectedPoint.latlng))

src/app/components/Map/index.tsx

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const Map = (props: MapProps) => {
310310
precision={layerConf.data_precision}
311311
/>
312312
</CustomControlMap>
313-
{!isMobile && (
313+
{!isMobile && currentMap.op !== 'screenshot' && (
314314
<MousePositionComponent
315315
position={'bottomright'}
316316
customComponent={
@@ -333,39 +333,35 @@ const Map = (props: MapProps) => {
333333
</CustomControlMap>
334334
{/*<BaseLayerControl/>*/}
335335

336-
<LayersControl position="topright">
337-
<LayersControl.BaseLayer checked name="OpenStreetMap">
338-
<TileLayer
339-
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
340-
attribution='&copy; <a target="_blank" rel="noopener" href="http://osm.org/copyright">OpenStreetMap</a> contributors'
341-
/>
342-
</LayersControl.BaseLayer>
343-
<LayersControl.BaseLayer name="Sentinel 2">
344-
<TileLayer
345-
url="https://tiles.maps.eox.at/wmts?layer=s2cloudless-2021_3857&style=default&tilematrixset=GoogleMapsCompatible&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={z}&TileCol={x}&TileRow={y}"
346-
attribution='&copy; <a target="_blank" rel="noopener" href="https://tiles.maps.eox.at/">Sentinel-2 cloudless</a> by EOX'
347-
/>
348-
</LayersControl.BaseLayer>
349-
<LayersControl.BaseLayer name="OpenTopoMap">
350-
<TileLayer
351-
url="https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png"
352-
attribution='map data: © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
353-
/>
354-
</LayersControl.BaseLayer>
355-
</LayersControl>
356-
<StationsLayer
357-
data={data}
358-
variable={currentMap.climatological_variable}
359-
url={currentMap.observation_stations_vector_tile_layer_url}
360-
zIndex={550}
361-
></StationsLayer>
336+
{currentMap.op !== 'screenshot' ? (
337+
<LayersControl position="topright">
338+
<LayersControl.BaseLayer checked name="OpenStreetMap">
339+
<TileLayer
340+
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
341+
attribution='&copy; <a target="_blank" rel="noopener" href="http://osm.org/copyright">OpenStreetMap</a> contributors'
342+
/>
343+
</LayersControl.BaseLayer>
344+
<LayersControl.BaseLayer name="Sentinel 2">
345+
<TileLayer
346+
url="https://tiles.maps.eox.at/wmts?layer=s2cloudless-2021_3857&style=default&tilematrixset=GoogleMapsCompatible&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={z}&TileCol={x}&TileRow={y}"
347+
attribution='&copy; <a target="_blank" rel="noopener" href="https://tiles.maps.eox.at/">Sentinel-2 cloudless</a> by EOX'
348+
/>
349+
</LayersControl.BaseLayer>
350+
<LayersControl.BaseLayer name="OpenTopoMap">
351+
<TileLayer
352+
url="https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png"
353+
attribution='map data: © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
354+
/>
355+
</LayersControl.BaseLayer>
356+
</LayersControl>
357+
) : (
358+
<></>
359+
)}
360+
<StationsLayer data={data} zIndex={550}></StationsLayer>
362361
<DynamicStationsLayer
363362
data={data}
364363
variable={currentMap.climatological_variable}
365-
url={currentMap.observation_stations_vector_tile_layer_url?.replace(
366-
'http://localhost:5001',
367-
'https://arpav.geobeyond.dev',
368-
)}
364+
url={layerConf.observation_stations_vector_tile_layer_url}
369365
zIndex={575}
370366
></DynamicStationsLayer>
371367
<VectorWrapperLayer

src/app/components/MapMenuBar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export function MapMenuBar(props: MapMenuBar) {
328328
showModal.current = false;
329329
console.log('activatingCV', value, combinations[value]);
330330
setActiveCombinations(combinations[value]);
331-
localCM.current = toDefault(combinations[value + '::thirty_year']);
331+
localCM.current = toDefault(combinations[value + '::30yr']);
332332
setCurrentMap(localCM.current);
333333
} else {
334334
const steps = [
@@ -471,7 +471,7 @@ export function MapMenuBar(props: MapMenuBar) {
471471
- ${labelFor(localCM.current.aggregation_period)}
472472
- ${labelFor(localCM.current.measure)}
473473
${localCM.current.time_window &&
474-
localCM.current.aggregation_period === 'thirty_year'
474+
localCM.current.aggregation_period === '30yr'
475475
? ' - ' + labelFor(localCM.current.time_window)
476476
: ''
477477
}

src/app/components/TimeSeriesDialog/DownloadForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const DownloadForm = props => {
151151
: null,
152152
data.current?.series?.filter(
153153
x =>
154-
'station' in x.info &&
154+
x.info.dataset_type === 'observation' &&
155155
x.info.processing_method === filter.current.sensorSmoothing,
156156
)[0],
157157
];

0 commit comments

Comments
 (0)