@eeacms/volto-n2k 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.coverage.babel.config.js +9 -0
- package/.release-it.json +17 -0
- package/CHANGELOG.md +155 -0
- package/DEVELOP.md +53 -0
- package/Jenkinsfile +209 -0
- package/LICENSE.md +9 -0
- package/README.md +62 -0
- package/bootstrap +41 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/integration/block-basics.js +32 -0
- package/cypress/plugins/index.js +26 -0
- package/cypress/support/commands.js +315 -0
- package/cypress/support/index.js +53 -0
- package/cypress.json +12 -0
- package/jest-addon.config.js +36 -0
- package/package.json +57 -0
- package/src/actions.js +20 -0
- package/src/components/index.js +3 -0
- package/src/components/manage/Blocks/BodyClass/Edit.jsx +29 -0
- package/src/components/manage/Blocks/BodyClass/View.jsx +13 -0
- package/src/components/manage/Blocks/BodyClass/index.js +24 -0
- package/src/components/manage/Blocks/BodyClass/schema.js +19 -0
- package/src/components/manage/Blocks/BubbleChart/BubbleChart.jsx +101 -0
- package/src/components/manage/Blocks/BubbleChart/Chart.jsx +67 -0
- package/src/components/manage/Blocks/BubbleChart/ChartContext.jsx +3 -0
- package/src/components/manage/Blocks/BubbleChart/View.jsx +63 -0
- package/src/components/manage/Blocks/BubbleChart/index.js +17 -0
- package/src/components/manage/Blocks/BubbleChart/schema.js +124 -0
- package/src/components/manage/Blocks/BubbleChart/style.less +12 -0
- package/src/components/manage/Blocks/CarouselHorizontal/HorizontalView.jsx +221 -0
- package/src/components/manage/Blocks/CarouselHorizontal/index.js +19 -0
- package/src/components/manage/Blocks/CarouselHorizontal/schema.js +32 -0
- package/src/components/manage/Blocks/CddaShape/View.jsx +109 -0
- package/src/components/manage/Blocks/CddaShape/index.js +23 -0
- package/src/components/manage/Blocks/CddaShape/schema.js +19 -0
- package/src/components/manage/Blocks/CddaShape/style.less +14 -0
- package/src/components/manage/Blocks/ContactBlock/View.jsx +56 -0
- package/src/components/manage/Blocks/ContactBlock/icons/domain.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/icons/email.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/icons/location.svg +1 -0
- package/src/components/manage/Blocks/ContactBlock/index.js +17 -0
- package/src/components/manage/Blocks/ContactBlock/schema.js +57 -0
- package/src/components/manage/Blocks/ContactBlock/styles.less +31 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/Pie.jsx +125 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/View.jsx +80 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/index.js +17 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/schema.js +75 -0
- package/src/components/manage/Blocks/ExplodedPiesChart/style.less +80 -0
- package/src/components/manage/Blocks/ExploreHabitats/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreHabitats/View.jsx +177 -0
- package/src/components/manage/Blocks/ExploreHabitats/index.js +24 -0
- package/src/components/manage/Blocks/ExploreHabitats/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreHabitats/style.less +15 -0
- package/src/components/manage/Blocks/ExploreSites/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreSites/View.jsx +175 -0
- package/src/components/manage/Blocks/ExploreSites/index.js +24 -0
- package/src/components/manage/Blocks/ExploreSites/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreSites/style.less +15 -0
- package/src/components/manage/Blocks/ExploreSpecies/Edit.jsx +29 -0
- package/src/components/manage/Blocks/ExploreSpecies/View.jsx +177 -0
- package/src/components/manage/Blocks/ExploreSpecies/index.js +24 -0
- package/src/components/manage/Blocks/ExploreSpecies/schema.js +15 -0
- package/src/components/manage/Blocks/ExploreSpecies/style.less +15 -0
- package/src/components/manage/Blocks/HabitatClassification/View.jsx +30 -0
- package/src/components/manage/Blocks/HabitatClassification/index.js +17 -0
- package/src/components/manage/Blocks/HabitatClassification/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatClassification/style.less +3 -0
- package/src/components/manage/Blocks/HabitatDistribution/View.jsx +97 -0
- package/src/components/manage/Blocks/HabitatDistribution/index.js +23 -0
- package/src/components/manage/Blocks/HabitatDistribution/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatDistribution/style.less +5 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/View.jsx +97 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/index.js +23 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatProtectedSites/style.less +5 -0
- package/src/components/manage/Blocks/HabitatsBanner/View.jsx +39 -0
- package/src/components/manage/Blocks/HabitatsBanner/index.js +17 -0
- package/src/components/manage/Blocks/HabitatsBanner/schema.js +19 -0
- package/src/components/manage/Blocks/HabitatsBanner/style.less +49 -0
- package/src/components/manage/Blocks/ImageText/Edit.jsx +98 -0
- package/src/components/manage/Blocks/ImageText/View.jsx +66 -0
- package/src/components/manage/Blocks/ImageText/index.js +24 -0
- package/src/components/manage/Blocks/ImageText/schema.js +69 -0
- package/src/components/manage/Blocks/ImageText/styles.less +87 -0
- package/src/components/manage/Blocks/Landing/DefalutView.jsx +83 -0
- package/src/components/manage/Blocks/Landing/Edit.jsx +219 -0
- package/src/components/manage/Blocks/Landing/EditBlockWrapper.jsx +161 -0
- package/src/components/manage/Blocks/Landing/View.jsx +65 -0
- package/src/components/manage/Blocks/Landing/images/background.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/coasts_and_seas.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/forests.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/grasslands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/hiker.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/islands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/mountains.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/natura2000.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/natura2000_square.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/peatlands.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/people_and_nature.webp +0 -0
- package/src/components/manage/Blocks/Landing/images/rivers.webp +0 -0
- package/src/components/manage/Blocks/Landing/index.js +104 -0
- package/src/components/manage/Blocks/Landing/schema.js +62 -0
- package/src/components/manage/Blocks/Landing/style.less +174 -0
- package/src/components/manage/Blocks/List/View.jsx +37 -0
- package/src/components/manage/Blocks/List/index.js +17 -0
- package/src/components/manage/Blocks/List/schema.js +49 -0
- package/src/components/manage/Blocks/List/style.less +12 -0
- package/src/components/manage/Blocks/NavigationAnchors/Edit.jsx +33 -0
- package/src/components/manage/Blocks/NavigationAnchors/View.jsx +132 -0
- package/src/components/manage/Blocks/NavigationAnchors/assets/external.png +0 -0
- package/src/components/manage/Blocks/NavigationAnchors/index.js +23 -0
- package/src/components/manage/Blocks/NavigationAnchors/schema.js +76 -0
- package/src/components/manage/Blocks/NavigationAnchors/styles.less +104 -0
- package/src/components/manage/Blocks/SimpleDataTable/index.js +16 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/View.jsx +178 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/index.js +4 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/schema.js +56 -0
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/style.less +54 -0
- package/src/components/manage/Blocks/SiteBanner/View.jsx +148 -0
- package/src/components/manage/Blocks/SiteBanner/index.js +17 -0
- package/src/components/manage/Blocks/SiteBanner/schema.js +19 -0
- package/src/components/manage/Blocks/SiteBanner/style.less +106 -0
- package/src/components/manage/Blocks/SiteHabitatsList/View.jsx +89 -0
- package/src/components/manage/Blocks/SiteHabitatsList/index.js +17 -0
- package/src/components/manage/Blocks/SiteHabitatsList/schema.js +19 -0
- package/src/components/manage/Blocks/SiteHabitatsList/style.less +70 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/View.jsx +47 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/images/background.webp +0 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/index.js +17 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/schema.js +19 -0
- package/src/components/manage/Blocks/SiteProtectedHabitats/style.less +90 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/View.jsx +55 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/images/background.webp +0 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/index.js +17 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/schema.js +19 -0
- package/src/components/manage/Blocks/SiteProtectedSpecies/style.less +90 -0
- package/src/components/manage/Blocks/SiteShape/View.jsx +107 -0
- package/src/components/manage/Blocks/SiteShape/index.js +23 -0
- package/src/components/manage/Blocks/SiteShape/schema.js +19 -0
- package/src/components/manage/Blocks/SiteShape/style.less +15 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/SortBy.jsx +52 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/SpeciesGroups.jsx +43 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/View.jsx +200 -0
- package/src/components/manage/Blocks/SiteSpeciesList/Filters/index.js +4 -0
- package/src/components/manage/Blocks/SiteSpeciesList/View.jsx +253 -0
- package/src/components/manage/Blocks/SiteSpeciesList/index.js +17 -0
- package/src/components/manage/Blocks/SiteSpeciesList/schema.js +19 -0
- package/src/components/manage/Blocks/SiteSpeciesList/style.less +264 -0
- package/src/components/manage/Blocks/SiteSpeciesList/utils.js +33 -0
- package/src/components/manage/Blocks/SlateLink/render.jsx +77 -0
- package/src/components/manage/Blocks/SlateLink/styles.less +22 -0
- package/src/components/manage/Blocks/SlateSVG/constants.js +1 -0
- package/src/components/manage/Blocks/SlateSVG/extensions.js +11 -0
- package/src/components/manage/Blocks/SlateSVG/index.js +47 -0
- package/src/components/manage/Blocks/SlateSVG/render.jsx +42 -0
- package/src/components/manage/Blocks/SlateSVG/schema.js +12 -0
- package/src/components/manage/Blocks/SlateSVG/styles.less +6 -0
- package/src/components/manage/Blocks/SpeciesBanner/View.jsx +109 -0
- package/src/components/manage/Blocks/SpeciesBanner/index.js +17 -0
- package/src/components/manage/Blocks/SpeciesBanner/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesBanner/style.less +115 -0
- package/src/components/manage/Blocks/SpeciesClassification/View.jsx +19 -0
- package/src/components/manage/Blocks/SpeciesClassification/index.js +17 -0
- package/src/components/manage/Blocks/SpeciesClassification/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesClassification/style.less +3 -0
- package/src/components/manage/Blocks/SpeciesDistribution/View.jsx +97 -0
- package/src/components/manage/Blocks/SpeciesDistribution/index.js +23 -0
- package/src/components/manage/Blocks/SpeciesDistribution/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesDistribution/style.less +5 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/View.jsx +97 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/index.js +23 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/schema.js +19 -0
- package/src/components/manage/Blocks/SpeciesProtectedSites/style.less +5 -0
- package/src/components/manage/Blocks/StackedBarChart/Chart.jsx +127 -0
- package/src/components/manage/Blocks/StackedBarChart/ChartContext.jsx +3 -0
- package/src/components/manage/Blocks/StackedBarChart/StackedBars.jsx +116 -0
- package/src/components/manage/Blocks/StackedBarChart/View.jsx +64 -0
- package/src/components/manage/Blocks/StackedBarChart/index.js +17 -0
- package/src/components/manage/Blocks/StackedBarChart/schema.js +25 -0
- package/src/components/manage/Blocks/StackedBarChart/style.less +37 -0
- package/src/components/manage/Blocks/TilesImages/Edit.jsx +32 -0
- package/src/components/manage/Blocks/TilesImages/View.jsx +37 -0
- package/src/components/manage/Blocks/TilesImages/index.js +23 -0
- package/src/components/manage/Blocks/TilesImages/schema.js +72 -0
- package/src/components/manage/Blocks/TilesImages/styles.less +57 -0
- package/src/components/theme/AppExtras/CopyPaste/CopyPaste.jsx +176 -0
- package/src/components/theme/AppExtras/CopyPaste/index.js +3 -0
- package/src/components/theme/AppExtras/CopyPaste/style.less +18 -0
- package/src/components/theme/AppExtras/MultilingualRedirector/MultilingualRedirector.jsx +35 -0
- package/src/components/theme/AppExtras/index.js +13 -0
- package/src/components/theme/Footer/Footer.jsx +209 -0
- package/src/components/theme/Header/Header.jsx +81 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.jsx +79 -0
- package/src/components/theme/LanguageSelector/styles.less +44 -0
- package/src/components/theme/Navigation/Navigation.jsx +453 -0
- package/src/components/theme/Sitemap/Sitemap.jsx +152 -0
- package/src/fonts/OpenSans-Bold.ttf +0 -0
- package/src/fonts/OpenSans-Regular.ttf +0 -0
- package/src/fonts/OpenSans-Semibold.ttf +0 -0
- package/src/fonts/Rajdhani-Bold.ttf +0 -0
- package/src/fonts/Rajdhani-Regular.ttf +0 -0
- package/src/grid.js +78 -0
- package/src/helpers.js +148 -0
- package/src/hocs/index.js +6 -0
- package/src/hocs/useResizeObserver.jsx +26 -0
- package/src/hocs/withLocalStorage.jsx +37 -0
- package/src/hocs/withScreenSize.jsx +43 -0
- package/src/icons/home.svg +12 -0
- package/src/icons/info.svg +5 -0
- package/src/icons/n2k-logo-transparent.png +0 -0
- package/src/icons/n2k-logo.png +0 -0
- package/src/icons/natura2000.svg +142 -0
- package/src/icons/placeholders/Algae.png +0 -0
- package/src/icons/placeholders/Amphibians.png +0 -0
- package/src/icons/placeholders/Birds.png +0 -0
- package/src/icons/placeholders/Conifers.png +0 -0
- package/src/icons/placeholders/Fishes.png +0 -0
- package/src/icons/placeholders/Fungi.png +0 -0
- package/src/icons/placeholders/Mammals.png +0 -0
- package/src/icons/placeholders/Plants.png +0 -0
- package/src/icons/placeholders/Reptiles.png +0 -0
- package/src/icons/placeholders/default.png +0 -0
- package/src/index.js +163 -0
- package/src/less/globals.less +3 -0
- package/src/less/styles.less +691 -0
- package/src/less/variables.less +2 -0
- package/src/static/cca.svg +61 -0
- package/src/static/ec.png +0 -0
- package/src/static/eea.png +0 -0
- package/src/static/eu.jpg +0 -0
- package/src/static/forest.svg +100 -0
- package/src/static/wise.png +0 -0
- package/src/store.js +24 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.exploded-pies-chart {
|
|
2
|
+
div.tooltip {
|
|
3
|
+
position: absolute;
|
|
4
|
+
z-index: 999;
|
|
5
|
+
max-width: 200px;
|
|
6
|
+
padding: 1em 2em;
|
|
7
|
+
border: 0px;
|
|
8
|
+
background: #629fca;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
border-radius: 1px solid #ccc;
|
|
11
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
|
|
12
|
+
color: #fff;
|
|
13
|
+
font: 12px sans-serif;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
text-align: center;
|
|
17
|
+
transform: translate(-50%, -120%);
|
|
18
|
+
|
|
19
|
+
&:before {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 99%;
|
|
22
|
+
left: 50%;
|
|
23
|
+
width: 0;
|
|
24
|
+
height: 0;
|
|
25
|
+
border: solid transparent;
|
|
26
|
+
border-width: 6px;
|
|
27
|
+
border-top-color: #629fca;
|
|
28
|
+
margin-left: -6px;
|
|
29
|
+
content: ' ';
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
div.text {
|
|
35
|
+
position: relative;
|
|
36
|
+
top: 50%;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-flow: column;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
text-align: right;
|
|
41
|
+
transform: translateY(-50%);
|
|
42
|
+
|
|
43
|
+
> * {
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
width: 100%;
|
|
46
|
+
color: #013c60;
|
|
47
|
+
font-family: 'OpenSans', arial;
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.value {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: calc(50% - 26px);
|
|
58
|
+
right: 0;
|
|
59
|
+
margin-bottom: 0;
|
|
60
|
+
font-size: 32px;
|
|
61
|
+
transform: translateY(-50%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.label {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: calc(50% + 22px);
|
|
67
|
+
right: 0;
|
|
68
|
+
transform: translateY(-50%);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.line {
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 50%;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 3px;
|
|
76
|
+
background-color: #013c60;
|
|
77
|
+
transform: translateY(-50%);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
3
|
+
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
4
|
+
import schema from './schema';
|
|
5
|
+
import View from './View';
|
|
6
|
+
|
|
7
|
+
const Edit = (props) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<View {...props} mode="edit" />
|
|
11
|
+
|
|
12
|
+
<SidebarPortal selected={props.selected}>
|
|
13
|
+
<InlineForm
|
|
14
|
+
schema={schema}
|
|
15
|
+
title={schema.title}
|
|
16
|
+
onChangeField={(id, value) => {
|
|
17
|
+
props.onChangeBlock(props.block, {
|
|
18
|
+
...props.data,
|
|
19
|
+
[id]: value,
|
|
20
|
+
});
|
|
21
|
+
}}
|
|
22
|
+
formData={props.data}
|
|
23
|
+
/>
|
|
24
|
+
</SidebarPortal>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Edit;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Message, Container } from 'semantic-ui-react';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import Map from '@eeacms/volto-openlayers-map/Map';
|
|
5
|
+
import { Interactions } from '@eeacms/volto-openlayers-map/Interactions';
|
|
6
|
+
import { Controls } from '@eeacms/volto-openlayers-map/Controls';
|
|
7
|
+
import { Layers, Layer } from '@eeacms/volto-openlayers-map/Layers';
|
|
8
|
+
import { openlayers } from '@eeacms/volto-openlayers-map';
|
|
9
|
+
import { getActiveHabitatsURL } from './index';
|
|
10
|
+
import './style.less';
|
|
11
|
+
|
|
12
|
+
const View = (props) => {
|
|
13
|
+
const [options, setOptions] = React.useState({});
|
|
14
|
+
const [vectorSource, setVectorSource] = useState(null);
|
|
15
|
+
const [tileWMSSource, setTileWMSSource] = useState(null);
|
|
16
|
+
const { extent, format, proj, style, source } = openlayers;
|
|
17
|
+
|
|
18
|
+
const { results = [], payload = {} } = props.search || {};
|
|
19
|
+
|
|
20
|
+
const activePageResults = results.filter((_, index) => {
|
|
21
|
+
return (
|
|
22
|
+
index >= (payload?.activePage - 1) * payload?.row_size &&
|
|
23
|
+
index <= payload?.activePage * payload?.row_size - 1
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (__SERVER__) return;
|
|
29
|
+
setVectorSource(new source.Vector());
|
|
30
|
+
setTileWMSSource(
|
|
31
|
+
new source.TileWMS({
|
|
32
|
+
extent: [
|
|
33
|
+
-3959514.742799999,
|
|
34
|
+
3193117.280200001,
|
|
35
|
+
3804815.2795,
|
|
36
|
+
1.1124223900300004e7,
|
|
37
|
+
],
|
|
38
|
+
url:
|
|
39
|
+
'https://bio.discomap.eea.europa.eu/arcgis/services/Article17/HabitatsDirective_ART_17_WMS_version_2020_08_public/MapServer/WmsServer?',
|
|
40
|
+
params: { LAYERS: '9', TILED: true },
|
|
41
|
+
serverType: 'geoserver',
|
|
42
|
+
// Countries have transparency, so do not fade tiles:
|
|
43
|
+
transition: 0,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
/* eslint-disable-next-line */
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (__SERVER__ || !vectorSource) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (activePageResults.length === 0 && vectorSource) {
|
|
55
|
+
vectorSource.clear();
|
|
56
|
+
setOptions({
|
|
57
|
+
...options,
|
|
58
|
+
extent: new extent.buffer(
|
|
59
|
+
[
|
|
60
|
+
-3959514.742799999,
|
|
61
|
+
3193117.280200001,
|
|
62
|
+
3804815.2795,
|
|
63
|
+
1.1124223900300004e7,
|
|
64
|
+
],
|
|
65
|
+
-3959514.742799999 * 0.01,
|
|
66
|
+
),
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const esrijsonFormat = new format.EsriJSON();
|
|
72
|
+
|
|
73
|
+
// Get habitats of active page
|
|
74
|
+
fetch(
|
|
75
|
+
getActiveHabitatsURL(
|
|
76
|
+
activePageResults.map((item) => `'${item.code_2000}'`),
|
|
77
|
+
),
|
|
78
|
+
).then(function (response) {
|
|
79
|
+
if (response.status !== 200) return;
|
|
80
|
+
|
|
81
|
+
vectorSource.clear();
|
|
82
|
+
|
|
83
|
+
response.json().then(function (data) {
|
|
84
|
+
if (data.features && data.features.length > 0) {
|
|
85
|
+
const features = esrijsonFormat.readFeatures(data);
|
|
86
|
+
if (features.length > 0) {
|
|
87
|
+
vectorSource.addFeatures(features);
|
|
88
|
+
const vectorExtent = vectorSource.getExtent();
|
|
89
|
+
let size = extent.getSize(vectorExtent);
|
|
90
|
+
setOptions({
|
|
91
|
+
...options,
|
|
92
|
+
extent: new extent.buffer(vectorExtent, size[0] * 0.03),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
/* eslint-disable-next-line */
|
|
99
|
+
}, [JSON.stringify(activePageResults)]);
|
|
100
|
+
|
|
101
|
+
if (__SERVER__ || !vectorSource) return '';
|
|
102
|
+
return (
|
|
103
|
+
<div className="explore-habitats-wrapper full-width">
|
|
104
|
+
<div className="explore-habitats">
|
|
105
|
+
<Map
|
|
106
|
+
view={{
|
|
107
|
+
center: proj.fromLonLat([20, 50]),
|
|
108
|
+
showFullExtent: true,
|
|
109
|
+
zoom: 5,
|
|
110
|
+
}}
|
|
111
|
+
{...options}
|
|
112
|
+
>
|
|
113
|
+
<Layers>
|
|
114
|
+
<Layer.Tile zIndex={0} />
|
|
115
|
+
<Layer.Tile source={tileWMSSource} zIndex={1} />
|
|
116
|
+
<Layer.Vector
|
|
117
|
+
source={vectorSource}
|
|
118
|
+
title="highlightLayer"
|
|
119
|
+
style={
|
|
120
|
+
new style.Style({
|
|
121
|
+
fill: new style.Fill({
|
|
122
|
+
color: 'rgba(255,255,255,0.4)',
|
|
123
|
+
}),
|
|
124
|
+
stroke: new style.Stroke({
|
|
125
|
+
color: '#04A77D',
|
|
126
|
+
// color: '#F8E473',
|
|
127
|
+
width: 3,
|
|
128
|
+
}),
|
|
129
|
+
image: new style.Circle({
|
|
130
|
+
radius: 5,
|
|
131
|
+
fill: new style.Fill({ color: 'rgba(4, 167, 125,0.6)' }),
|
|
132
|
+
// fill: new style.Fill({ color: 'rgba(248,228,115,0.6)' }),
|
|
133
|
+
stroke: new style.Stroke({
|
|
134
|
+
color: 'rgba(242, 180, 87, 1)',
|
|
135
|
+
width: 2,
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
zIndex={2}
|
|
141
|
+
/>
|
|
142
|
+
</Layers>
|
|
143
|
+
<Controls attribution={true} zoom={false} />
|
|
144
|
+
<Interactions
|
|
145
|
+
doubleClickZoom={true}
|
|
146
|
+
dragAndDrop={false}
|
|
147
|
+
dragPan={true}
|
|
148
|
+
keyboardPan={true}
|
|
149
|
+
keyboardZoom={true}
|
|
150
|
+
mouseWheelZoom={true}
|
|
151
|
+
pointer={false}
|
|
152
|
+
select={false}
|
|
153
|
+
/>
|
|
154
|
+
</Map>
|
|
155
|
+
</div>
|
|
156
|
+
<Container className="map-info-notice">
|
|
157
|
+
<Message style={{ color: '#3B7f02' }}>
|
|
158
|
+
<p>
|
|
159
|
+
The designations employed and the presentation of material on this
|
|
160
|
+
map do not imply the expression of any opinion whatsoever on the
|
|
161
|
+
part of the European Union concerning the legal status of any
|
|
162
|
+
country, territory, city or area or of its authorities, or
|
|
163
|
+
concerning the delimitation of its frontiers or boundaries.
|
|
164
|
+
</p>
|
|
165
|
+
<p>
|
|
166
|
+
<strong>Note:</strong> When you perform a search we will highlight
|
|
167
|
+
only the results available on the active page of the results table.
|
|
168
|
+
</p>
|
|
169
|
+
</Message>
|
|
170
|
+
</Container>
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export default connect((state) => ({
|
|
176
|
+
search: state.table_search || {},
|
|
177
|
+
}))(View);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ExploreHabitatsEdit from './Edit';
|
|
2
|
+
import ExploreHabitatsView from './View';
|
|
3
|
+
|
|
4
|
+
import worldSVG from '@plone/volto/icons/world.svg';
|
|
5
|
+
|
|
6
|
+
export function getActiveHabitatsURL(code_2000) {
|
|
7
|
+
return encodeURI(
|
|
8
|
+
`https://bio.discomap.eea.europa.eu/arcgis/rest/services/Article17/HabitatsDirective_ART_17_WMS_version_2020_08_public/MapServer/1/query?f=json&where=habitatcode IN (${code_2000.join(
|
|
9
|
+
',',
|
|
10
|
+
)})&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=OBJECTID,habitatcode&outSR=102100`,
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default (config) => {
|
|
15
|
+
config.blocks.blocksConfig.explore_habitats_map = {
|
|
16
|
+
id: 'explore_habitats_map',
|
|
17
|
+
title: 'Explore habitats map',
|
|
18
|
+
icon: worldSVG,
|
|
19
|
+
group: 'natura_2000',
|
|
20
|
+
edit: ExploreHabitatsEdit,
|
|
21
|
+
view: ExploreHabitatsView,
|
|
22
|
+
};
|
|
23
|
+
return config;
|
|
24
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
div#view .ui.container > .explore-habitats-wrapper,
|
|
2
|
+
div#view .ui.container > .explore-habitats {
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.explore-habitats {
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
background-color: #f8f8f8;
|
|
11
|
+
|
|
12
|
+
&.visible.transition {
|
|
13
|
+
display: flex !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
3
|
+
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
4
|
+
import schema from './schema';
|
|
5
|
+
import View from './View';
|
|
6
|
+
|
|
7
|
+
const Edit = (props) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<View {...props} mode="edit" />
|
|
11
|
+
|
|
12
|
+
<SidebarPortal selected={props.selected}>
|
|
13
|
+
<InlineForm
|
|
14
|
+
schema={schema}
|
|
15
|
+
title={schema.title}
|
|
16
|
+
onChangeField={(id, value) => {
|
|
17
|
+
props.onChangeBlock(props.block, {
|
|
18
|
+
...props.data,
|
|
19
|
+
[id]: value,
|
|
20
|
+
});
|
|
21
|
+
}}
|
|
22
|
+
formData={props.data}
|
|
23
|
+
/>
|
|
24
|
+
</SidebarPortal>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Edit;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Message, Container } from 'semantic-ui-react';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import Map from '@eeacms/volto-openlayers-map/Map';
|
|
5
|
+
import { Interactions } from '@eeacms/volto-openlayers-map/Interactions';
|
|
6
|
+
import { Controls } from '@eeacms/volto-openlayers-map/Controls';
|
|
7
|
+
import { Layers, Layer } from '@eeacms/volto-openlayers-map/Layers';
|
|
8
|
+
import { openlayers } from '@eeacms/volto-openlayers-map';
|
|
9
|
+
import { getActiveSitesURL } from './index';
|
|
10
|
+
import './style.less';
|
|
11
|
+
|
|
12
|
+
const View = (props) => {
|
|
13
|
+
const [options, setOptions] = React.useState({});
|
|
14
|
+
const [vectorSource, setVectorSource] = useState(null);
|
|
15
|
+
const [tileWMSSource, setTileWMSSource] = useState(null);
|
|
16
|
+
const { extent, format, proj, style, source } = openlayers;
|
|
17
|
+
|
|
18
|
+
const { results = [], payload = {} } = props.search || {};
|
|
19
|
+
|
|
20
|
+
const activePageResults = results.filter((_, index) => {
|
|
21
|
+
return (
|
|
22
|
+
index >= (payload?.activePage - 1) * payload?.row_size &&
|
|
23
|
+
index <= payload?.activePage * payload?.row_size - 1
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (__SERVER__) return;
|
|
29
|
+
setVectorSource(new source.Vector());
|
|
30
|
+
setTileWMSSource(
|
|
31
|
+
new source.TileWMS({
|
|
32
|
+
extent: [
|
|
33
|
+
-3603195.606899999,
|
|
34
|
+
3197087.8112000003,
|
|
35
|
+
3796164.5945000015,
|
|
36
|
+
1.1077138825000003e7,
|
|
37
|
+
],
|
|
38
|
+
url:
|
|
39
|
+
'https://bio.discomap.eea.europa.eu/arcgis/services/ProtectedSites/Natura2000Sites/MapServer/WMSServer',
|
|
40
|
+
params: { LAYERS: '2', TILED: true },
|
|
41
|
+
serverType: 'geoserver',
|
|
42
|
+
// Countries have transparency, so do not fade tiles:
|
|
43
|
+
transition: 0,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
/* eslint-disable-next-line */
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (__SERVER__ || !vectorSource) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (activePageResults.length === 0 && vectorSource) {
|
|
55
|
+
vectorSource.clear();
|
|
56
|
+
setOptions({
|
|
57
|
+
...options,
|
|
58
|
+
extent: new extent.buffer(
|
|
59
|
+
[
|
|
60
|
+
-3603195.606899999,
|
|
61
|
+
3197087.8112000003,
|
|
62
|
+
3796164.5945000015,
|
|
63
|
+
1.1077138825000003e7,
|
|
64
|
+
],
|
|
65
|
+
-3603195.606899999 * 0.01,
|
|
66
|
+
),
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const esrijsonFormat = new format.EsriJSON();
|
|
72
|
+
|
|
73
|
+
// Get sites of active page
|
|
74
|
+
fetch(
|
|
75
|
+
getActiveSitesURL(activePageResults.map((item) => `'${item.site_code}'`)),
|
|
76
|
+
).then(function (response) {
|
|
77
|
+
if (response.status !== 200) return;
|
|
78
|
+
|
|
79
|
+
vectorSource.clear();
|
|
80
|
+
|
|
81
|
+
response.json().then(function (data) {
|
|
82
|
+
if (data.features && data.features.length > 0) {
|
|
83
|
+
const features = esrijsonFormat.readFeatures(data);
|
|
84
|
+
if (features.length > 0) {
|
|
85
|
+
vectorSource.addFeatures(features);
|
|
86
|
+
const vectorExtent = vectorSource.getExtent();
|
|
87
|
+
let size = extent.getSize(vectorExtent);
|
|
88
|
+
setOptions({
|
|
89
|
+
...options,
|
|
90
|
+
extent: new extent.buffer(vectorExtent, size[0] * 0.03),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
/* eslint-disable-next-line */
|
|
97
|
+
}, [JSON.stringify(activePageResults)]);
|
|
98
|
+
|
|
99
|
+
if (__SERVER__ || !vectorSource) return '';
|
|
100
|
+
return (
|
|
101
|
+
<div className="explore-sites-wrapper full-width">
|
|
102
|
+
<div className="explore-sites">
|
|
103
|
+
<Map
|
|
104
|
+
view={{
|
|
105
|
+
center: proj.fromLonLat([20, 50]),
|
|
106
|
+
showFullExtent: true,
|
|
107
|
+
zoom: 5,
|
|
108
|
+
}}
|
|
109
|
+
{...options}
|
|
110
|
+
>
|
|
111
|
+
<Layers>
|
|
112
|
+
<Layer.Tile zIndex={0} />
|
|
113
|
+
<Layer.Tile source={tileWMSSource} zIndex={1} />
|
|
114
|
+
<Layer.Vector
|
|
115
|
+
source={vectorSource}
|
|
116
|
+
title="highlightLayer"
|
|
117
|
+
style={
|
|
118
|
+
new style.Style({
|
|
119
|
+
fill: new style.Fill({
|
|
120
|
+
color: 'rgba(255,255,255,0.4)',
|
|
121
|
+
}),
|
|
122
|
+
stroke: new style.Stroke({
|
|
123
|
+
color: '#04A77D',
|
|
124
|
+
// color: '#F8E473',
|
|
125
|
+
width: 3,
|
|
126
|
+
}),
|
|
127
|
+
image: new style.Circle({
|
|
128
|
+
radius: 5,
|
|
129
|
+
fill: new style.Fill({ color: 'rgba(4, 167, 125,0.6)' }),
|
|
130
|
+
// fill: new style.Fill({ color: 'rgba(248,228,115,0.6)' }),
|
|
131
|
+
stroke: new style.Stroke({
|
|
132
|
+
color: 'rgba(242, 180, 87, 1)',
|
|
133
|
+
width: 2,
|
|
134
|
+
}),
|
|
135
|
+
}),
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
zIndex={2}
|
|
139
|
+
/>
|
|
140
|
+
</Layers>
|
|
141
|
+
<Controls attribution={true} zoom={false} />
|
|
142
|
+
<Interactions
|
|
143
|
+
doubleClickZoom={true}
|
|
144
|
+
dragAndDrop={false}
|
|
145
|
+
dragPan={true}
|
|
146
|
+
keyboardPan={true}
|
|
147
|
+
keyboardZoom={true}
|
|
148
|
+
mouseWheelZoom={true}
|
|
149
|
+
pointer={false}
|
|
150
|
+
select={false}
|
|
151
|
+
/>
|
|
152
|
+
</Map>
|
|
153
|
+
</div>
|
|
154
|
+
<Container className="map-info-notice">
|
|
155
|
+
<Message style={{ color: '#3B7f02' }}>
|
|
156
|
+
<p>
|
|
157
|
+
The designations employed and the presentation of material on this
|
|
158
|
+
map do not imply the expression of any opinion whatsoever on the
|
|
159
|
+
part of the European Union concerning the legal status of any
|
|
160
|
+
country, territory, city or area or of its authorities, or
|
|
161
|
+
concerning the delimitation of its frontiers or boundaries.
|
|
162
|
+
</p>
|
|
163
|
+
<p>
|
|
164
|
+
<strong>Note:</strong> When you perform a search we will highlight
|
|
165
|
+
only the results available on the active page of the results table.
|
|
166
|
+
</p>
|
|
167
|
+
</Message>
|
|
168
|
+
</Container>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default connect((state) => ({
|
|
174
|
+
search: state.table_search || {},
|
|
175
|
+
}))(View);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ExploreSitesEdit from './Edit';
|
|
2
|
+
import ExploreSitesView from './View';
|
|
3
|
+
|
|
4
|
+
import worldSVG from '@plone/volto/icons/world.svg';
|
|
5
|
+
|
|
6
|
+
export function getActiveSitesURL(site_codes) {
|
|
7
|
+
return encodeURI(
|
|
8
|
+
`https://bio.discomap.eea.europa.eu/arcgis/rest/services/ProtectedSites/Natura2000Sites/MapServer/2/query?f=json&where=SITECODE IN (${site_codes.join(
|
|
9
|
+
',',
|
|
10
|
+
)})&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=OBJECTID&outSR=102100`,
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default (config) => {
|
|
15
|
+
config.blocks.blocksConfig.explore_sites_map = {
|
|
16
|
+
id: 'explore_sites_map',
|
|
17
|
+
title: 'Explore sites map',
|
|
18
|
+
icon: worldSVG,
|
|
19
|
+
group: 'natura_2000',
|
|
20
|
+
edit: ExploreSitesEdit,
|
|
21
|
+
view: ExploreSitesView,
|
|
22
|
+
};
|
|
23
|
+
return config;
|
|
24
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
div#view .ui.container > .explore-sites-wrapper,
|
|
2
|
+
div#view .ui.container > .explore-sites {
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.explore-sites {
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
background-color: #f8f8f8;
|
|
11
|
+
|
|
12
|
+
&.visible.transition {
|
|
13
|
+
display: flex !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
3
|
+
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
4
|
+
import schema from './schema';
|
|
5
|
+
import View from './View';
|
|
6
|
+
|
|
7
|
+
const Edit = (props) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<View {...props} mode="edit" />
|
|
11
|
+
|
|
12
|
+
<SidebarPortal selected={props.selected}>
|
|
13
|
+
<InlineForm
|
|
14
|
+
schema={schema}
|
|
15
|
+
title={schema.title}
|
|
16
|
+
onChangeField={(id, value) => {
|
|
17
|
+
props.onChangeBlock(props.block, {
|
|
18
|
+
...props.data,
|
|
19
|
+
[id]: value,
|
|
20
|
+
});
|
|
21
|
+
}}
|
|
22
|
+
formData={props.data}
|
|
23
|
+
/>
|
|
24
|
+
</SidebarPortal>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Edit;
|