Skip to content

Commit

Permalink
Got product indicators working
Browse files Browse the repository at this point in the history
  • Loading branch information
pda-sedano committed Jan 31, 2023
1 parent 1498683 commit f59c2e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/components/LeafletMap/LeafletMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,15 @@ export const LeafletMap = ({setMap, animating, animationTime}) => {
>
<Control position='bottomright'>
<MapLegend />
<ProductIndicator selector={state => selectLayerProperty(state, 'overlayIndex')} productsList={config.overlaysList} />
</Control>
<MapController currentGraphCoords={currentGraphCoords} setMap={setMap} modisData={modisData}
setModisData={setModisData} modisDataConfig={modisDataConfig}
setModisDataConfig={setModisDataConfig} />
<AnimationController animating={animating} animationTime={animationTime} />
{/* <ProductIndicator selector={state => selectLayerProperty(state, 'productIndex')} productsList={config.productsList} />
<ProductIndicator selector={state => selectLayerProperty(state, 'overlayIndex')} productsList={config.overlaysList} /> */}
<Control position='bottomleft'>
<ProductIndicator selector={state => selectLayerProperty(state, 'productIndex')} productsList={config.productsList} />
</Control>
</MapContainer>
</Grid>
<NDVIMultiYearGraph modisData={modisData} modisDataConfig={modisDataConfig} />
Expand Down
4 changes: 1 addition & 3 deletions src/components/ProductIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useSelector } from "react-redux";
export const ProductIndicator = ({ selector, productsList }) => {
const productIndex = useSelector(selector);

const map = useMap();

return (
<div style={{position: 'absolute', width: 100, height: 50, top: 100, right: 100}}>
<div style={{background: 'whitesmoke', color: 'black'}}>
{productsList[productIndex]}
</div>
);
Expand Down

0 comments on commit f59c2e9

Please sign in to comment.