From 83f3e7739e4df6415f107543515f7c6f75543661 Mon Sep 17 00:00:00 2001 From: Mihai Macaneata Date: Thu, 25 Jun 2020 11:00:36 +0300 Subject: [PATCH] use webmap for browse the data --- .../theme/View/BrowseView/BrowseMap.jsx | 125 ++++++++++-------- 1 file changed, 72 insertions(+), 53 deletions(-) diff --git a/src/components/theme/View/BrowseView/BrowseMap.jsx b/src/components/theme/View/BrowseView/BrowseMap.jsx index 6f2575c6..855d7948 100644 --- a/src/components/theme/View/BrowseView/BrowseMap.jsx +++ b/src/components/theme/View/BrowseView/BrowseMap.jsx @@ -2,67 +2,86 @@ import React, { useState } from 'react'; import { Grid, Dropdown, Radio } from 'semantic-ui-react'; import { options, sites, quickFacts, tableItems } from './browseConstants'; import MapModal from './MapModal'; +import MapView from 'volto-addons/WebMap/WebMap'; const BrowseMap = () => { + const [mapModal, setMapModal] = useState(undefined); + const [checkedSite, setCheckedSite] = useState({ + label: 'Show All', + value: 'all', + }); - const [mapModal, setMapModal] = useState(undefined); - const [checkedSite, setCheckedSite] = useState({label: "Show All",value: "all"}) - - return ( - - -
- -

Dynamic filter -

-

Reporting year

- -

Industrial sites in this area

- {sites.map((item, index) => - - setCheckedSite(item)} - /> - - )} -

Quick facts

- { - quickFacts.map(fact => -
-

{fact.title}

-

{fact.reportingSites} reporting sites

-

Most common industry: {fact.commonIndustry} industry

-

Most common pollutant: {fact.commonPollutant}

-
- ) - } - -
+ tabIndex="0"> */} + +
+ +

Dynamic filter

+

Reporting year

+ +

Industrial sites in this area

+ {sites.map((item, index) => ( + + setCheckedSite(item)} + /> + + ))} +

Quick facts

+ {quickFacts.map(fact => ( +
+

{fact.title}

+

+ {fact.reportingSites} reporting sites +

+

+ Most common industry: {fact.commonIndustry} industry +

+

+ Most common pollutant: {fact.commonPollutant} +

- - { - mapModal && - setMapModal(undefined)} /> - } - - ); -} + ))} +
+
+ + {mapModal && ( + setMapModal(undefined)} /> + )} + + ); +}; -export default BrowseMap; \ No newline at end of file +export default BrowseMap;