Commit 69a56b6f authored by amarcic's avatar amarcic
Browse files

added more section comments(incomplete)

parent 30f85921
......@@ -106,7 +106,7 @@ export const OurMap = () => {
i18n.changeLanguage(lng);
};
//state
//state management with reducer
function inputReducer(state, action) {
const {type, payload} = action;
switch (type) {
......@@ -584,6 +584,7 @@ export const OurMap = () => {
</Grid>)
}
</Grid>
{/*loading indicator and button to toggle display of related objects*/}
<Grid item className="grid-loading-indicator" xs={12}>
{/*{input.showSearchResults && <span>Showing search results</span>}
{input.showRelatedObjects && <span>Showing related objects of </span>}
......@@ -611,6 +612,7 @@ export const OurMap = () => {
Return to search results (hide related objects)
</Button>}
</Grid>
{/*and finally: the map!*/}
<Grid className="grid-map" item xs={12} lg={9}>
<Map
className="markercluster-map"
......@@ -631,6 +633,7 @@ export const OurMap = () => {
url={osmTiles}
noWrap={true}
/>
{/*drawing the bounding box*/}
{(/-?\d{1,2}\.\d+,-?\d{1,3}\.\d+/.test(input.boundingBoxCorner1))
&&<Circle
center={input.boundingBoxCorner1}
......@@ -648,7 +651,13 @@ export const OurMap = () => {
opacity={0.25}
fillOpacity={0.05}
/>}
{input.showRelatedObjects&&input.objectId&&mapDataContext&&mapDataContext.entity&&mapDataContext.entity.spatial
{ //conditions for displaying markers, for which related objects are displayed
input.showRelatedObjects
&&input.objectId
&&mapDataContext
&&mapDataContext.entity
&&mapDataContext.entity.spatial
//creating markers for each set of spatial data
&&mapDataContext.entity.spatial.map( (place, indexPlace) =>
{return(place
&&<Marker
......@@ -657,11 +666,25 @@ export const OurMap = () => {
position={place.coordinates.split(", ").reverse()}
opacity={1}
>
<ReturnPopup object={mapDataContext.entity} place={place} handleRelatedObjects={handleRelatedObjects} showRelatedObjects={input.showRelatedObjects} mapDataContextEntity={mapDataContext.entity}/>
<ReturnPopup
object={mapDataContext.entity}
place={place}
handleRelatedObjects={handleRelatedObjects}
showRelatedObjects={input.showRelatedObjects}
mapDataContextEntity={mapDataContext.entity}
/>
</Marker>
)})}
)}
)}
{/*Marker Cluster for markers of related objects*/}
<MarkerClusterGroup>
{input.showRelatedObjects&&input.objectId&&mapDataContext&&mapDataContext.entity&&mapDataContext.entity.related
{//conditions for displaying markers for related objects
input.showRelatedObjects
&&input.objectId
&&mapDataContext
&&mapDataContext.entity
&&mapDataContext.entity.related
//creating markers for each related object
&&mapDataContext.entity.related.map( (relatedObj, indexRelatedObj) =>
{
if(relatedObj===null) return;
......@@ -679,9 +702,20 @@ export const OurMap = () => {
)})
)
})}
{input.showSearchResults&&(input.searchStr!==""||input.projectList.length!==0||input.chronOntologyTerm!==""
||(input.boundingBoxCorner1.length!==0&&input.boundingBoxCorner2.length!==0))&&mapDataObjectsByString
&&mapDataObjectsByString.entitiesMultiFilter&&mapDataObjectsByString.entitiesMultiFilter.map( (entity, indexEntity) =>
{//conditions for
input.showSearchResults
&&(
input.searchStr!==""
||input.projectList.length!==0
||input.chronOntologyTerm!==""
||(
input.boundingBoxCorner1.length!==0
&&input.boundingBoxCorner2.length!==0
)
)&&mapDataObjectsByString
&&mapDataObjectsByString.entitiesMultiFilter
//creating markers for...
&&mapDataObjectsByString.entitiesMultiFilter.map( (entity, indexEntity) =>
{return(entity.spatial
&& entity.spatial.map( (place, indexPlace) =>
{ return( place
......@@ -694,8 +728,15 @@ export const OurMap = () => {
</Marker>
)}
)
)})}
{input.showArchaeoSites&&(input.searchStr!==""||input.regionId!==0)&&mapDataSitesByRegion
)}
)}
{//conditions for
input.showArchaeoSites
&&(
input.searchStr!==""
||input.regionId!==0
)&&mapDataSitesByRegion
//creating markers for...
&& mapDataSitesByRegion.sitesByRegion && mapDataSitesByRegion.sitesByRegion.map((site, indexSite) => {
return (site
&& <Marker
......@@ -709,7 +750,14 @@ export const OurMap = () => {
}
)
}
{input.showArchaeoSites&&(input.searchStr!==""||(input.boundingBoxCorner1.length!==0&&input.boundingBoxCorner2.length!==0))&&mapDataArchaeoSites
{
input.showArchaeoSites
&&(
input.searchStr!==""
||(input.boundingBoxCorner1.length!==0
&&input.boundingBoxCorner2.length!==0)
)&&mapDataArchaeoSites
//creating markers for...
&& mapDataArchaeoSites.archaeologicalSites && mapDataArchaeoSites.archaeologicalSites.map((site, indexSite) => {
return (site
&& <Marker
......@@ -726,6 +774,7 @@ export const OurMap = () => {
</MarkerClusterGroup>
</Map>
</Grid>
{/*search/filter result list*/}
{<Grid className="grid-results-list-outer" item xs={12} lg={3} container direction="column">
{/*<Paper>*/}
{<Grid className="grid-results-list" item container direction="column">
......
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