Commit 04a3ff19 authored by Elisabeth Reuhl's avatar Elisabeth Reuhl
Browse files

Worked on ReturnPopup component

parent 6b35eb21
......@@ -259,7 +259,7 @@ export const OurMap = () => {
position={place.coordinates.split(", ").reverse()}
opacity={1}
>
{ReturnPopup(mapDataContext.entity, place, handleRelatedObjects)}
<ReturnPopup object={mapDataContext.entity} place={place} handleRelatedObjects={handleRelatedObjects} showRelatedObjects={input.showRelatedObjects}/>
</Marker>
)})}
<MarkerClusterGroup>
......@@ -276,7 +276,7 @@ export const OurMap = () => {
position={place.coordinates.split(", ").reverse()}
opacity={0.5}
>
{ReturnPopup(relatedObj, place, handleRelatedObjects)}
<ReturnPopup object={relatedObj} place={place} handleRelatedObjects={handleRelatedObjects} showRelatedObjects={input.showRelatedObjects}/>
</Marker>
)})
)
......@@ -292,7 +292,7 @@ export const OurMap = () => {
//coordinates need to be reversed because of different standards between geojson and leaflet
position={place.coordinates.split(", ").reverse()}
>
{ReturnPopup(entity, place, handleRelatedObjects)}
<ReturnPopup object={entity} place={place} handleRelatedObjects={handleRelatedObjects} showRelatedObjects={input.showRelatedObjects}/>
</Marker>
)}
)
......
......@@ -2,7 +2,7 @@ import React from "react";
import {Popup} from "react-leaflet";
import {Button} from "@material-ui/core";
export const ReturnPopup = (object, place, hRO) => {
export const ReturnPopup = (object, place, handleRelatedObjects, showRelatedObjects) => {
return (
<Popup>
<div>
......@@ -20,11 +20,11 @@ export const ReturnPopup = (object, place, hRO) => {
)
}</ul>}*/}
<Button
onClick={() => {hRO(place.identifier)}}
onClick={() => {handleRelatedObjects(object.identifier)}}
name="showRelatedObjects"
variant="contained"
color="primary"
disabled={false}//OurMap.input.showRelatedObjects}
disabled={showRelatedObjects}
>
Show related objects
</Button>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment