Loading src/components/presentational/FootprintResults.jsx +1 −8 Original line number Diff line number Diff line Loading @@ -32,13 +32,6 @@ export default function FootprintResults(props) { const [oldTargetName, setOldTargetName] = React.useState(""); const [oldFilterString, setOldFilterString] = React.useState(""); /*const [selectedOptionsWithValues, setSelectedOptionsWithValues] = React.useState([]); // Function to update selected options and values const updateSelectedOptions = (selectedOptions) => { setSelectedOptionsWithValues(selectedOptions); }; */ const addFeatures = (newFeatures, key) => { let myFeatureCollections = featureCollections; myFeatureCollections[key].features.push(...newFeatures); Loading src/components/presentational/ResultsAccessories.jsx +7 −49 Original line number Diff line number Diff line Loading @@ -73,16 +73,13 @@ function determineDatasetType(features) { // Find the key that ends with "id" const idKey = propertyKeys.find(key => key.endsWith("id")); //console.log(idKey); if(!idKey) return 'unknown'; // If no id found if(features.stac_extensions) return "stac"; // Based on the key determine the type // Based on the key determine the type(in case we need to specify in the future) switch(idKey) { case "productid": return "hirise"; case "pdsvolid": return "hirise" default: return 'unknown'; } Loading Loading @@ -113,22 +110,17 @@ export function FootprintCard(props){ //initialize variables let ThumbnailLink = ''; let modifiedProductId = ''; let BrowserLink = ''; let showMetadata; let stacAPIFlag = false; let pyGeoAPIFlag = false; const { selectedOptionsWithValues } = props; // Metadata Popup const geoTiffViewer = new GeoTiffViewer("GeoTiffAsset"); //determine feature type const featureType = determineDatasetType(props.feature); //console.log("Dataset type is:", featureType); //debugging //console.log(props.feature); //debugging //check for feature type in order to gather correct meta data switch(featureType) { Loading @@ -140,7 +132,6 @@ export function FootprintCard(props){ // set boolean stacAPIFlag = true; // display meta data for STAC api showMetadata = (value) => () => { geoTiffViewer.displayGeoTiff(value.assets.thumbnail.href); Loading @@ -152,30 +143,9 @@ export function FootprintCard(props){ ); geoTiffViewer.openModal(); }; break; case "hirise": // Switch the id and date and link // props.feature.id = props.feature.properties.productid; //props.feature.properties.datetime = props.feature.properties.createdate; //modifiedProductId = props.feature.id.replace(/_RED|_COLOR/g, ''); //ThumbnailLink = 'https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/ESP/ORB_012600_012699/' + modifiedProductId + '/' + props.feature.id + '.thumb.jpg'; //BrowserLink = props.feature.properties.produrl; // set boolean pyGeoAPIFlag = true; //display different modal for PyGeo API showMetadata = (value) => () => { //geoTiffViewer.displayGeoTiff(ThumbnailLink); geoTiffViewer.changeMetaData( value.properties.datasetid, value.properties.productid, value.properties.datetime, value.links ); geoTiffViewer.openModal(); }; break; default: pyGeoAPIFlag = true; //display different modal for PyGeo API Loading @@ -187,15 +157,11 @@ export function FootprintCard(props){ value.properties.datetime, value.links ); } break; } }; break; }; const cardClick = () => { window.postMessage(["zoomFootprint", props.feature], "*"); Loading Loading @@ -247,14 +213,6 @@ export function FootprintCard(props){ <strong>ID:</strong> {props.feature.id} </div> <div className="resultSub"> {/*} <ul> {selectedOptionsWithValues.map((optionWithValues, index) => ( <li key={index}> <strong>Option:</strong> {optionWithValues.option}, <strong>Value:</strong> {optionWithValues.value} </li> ))} </ul> */} {props.feature?.properties && Object.entries(props.feature.properties).map(([key, value]) => { // Check if the key exists in the selected queryables Loading src/components/presentational/SearchAndFilterInput.jsx +0 −3 Original line number Diff line number Diff line Loading @@ -158,13 +158,10 @@ export default function SearchAndFilterInput(props) { // retrieves all PyGEO collections const isInPyAPI = collection.filter(data => data.hasOwnProperty('itemType')); //console.log(isInPyAPI); // finds and assigns the selected collection from the PYGEO api const selectedCollection = isInPyAPI.find(data => data.title === props.selectedTitle); //console.log(selectedCollection); // retrieves all pyGEO titles const collectionTitles = isInPyAPI.map(data => data.title); Loading src/components/presentational/Sidebar.jsx +0 −2 Original line number Diff line number Diff line Loading @@ -56,10 +56,8 @@ export default function Sidebar(props) { // Callback to update selected queryables const UpdateQueryableTitles = (selectedQueryables) => { updatedQueryableTitles = selectedQueryables; setUpdatedQueryableTitles(selectedQueryables) console.log("Selected Queryables: ", selectedQueryables); } return ( <> Loading Loading
src/components/presentational/FootprintResults.jsx +1 −8 Original line number Diff line number Diff line Loading @@ -32,13 +32,6 @@ export default function FootprintResults(props) { const [oldTargetName, setOldTargetName] = React.useState(""); const [oldFilterString, setOldFilterString] = React.useState(""); /*const [selectedOptionsWithValues, setSelectedOptionsWithValues] = React.useState([]); // Function to update selected options and values const updateSelectedOptions = (selectedOptions) => { setSelectedOptionsWithValues(selectedOptions); }; */ const addFeatures = (newFeatures, key) => { let myFeatureCollections = featureCollections; myFeatureCollections[key].features.push(...newFeatures); Loading
src/components/presentational/ResultsAccessories.jsx +7 −49 Original line number Diff line number Diff line Loading @@ -73,16 +73,13 @@ function determineDatasetType(features) { // Find the key that ends with "id" const idKey = propertyKeys.find(key => key.endsWith("id")); //console.log(idKey); if(!idKey) return 'unknown'; // If no id found if(features.stac_extensions) return "stac"; // Based on the key determine the type // Based on the key determine the type(in case we need to specify in the future) switch(idKey) { case "productid": return "hirise"; case "pdsvolid": return "hirise" default: return 'unknown'; } Loading Loading @@ -113,22 +110,17 @@ export function FootprintCard(props){ //initialize variables let ThumbnailLink = ''; let modifiedProductId = ''; let BrowserLink = ''; let showMetadata; let stacAPIFlag = false; let pyGeoAPIFlag = false; const { selectedOptionsWithValues } = props; // Metadata Popup const geoTiffViewer = new GeoTiffViewer("GeoTiffAsset"); //determine feature type const featureType = determineDatasetType(props.feature); //console.log("Dataset type is:", featureType); //debugging //console.log(props.feature); //debugging //check for feature type in order to gather correct meta data switch(featureType) { Loading @@ -140,7 +132,6 @@ export function FootprintCard(props){ // set boolean stacAPIFlag = true; // display meta data for STAC api showMetadata = (value) => () => { geoTiffViewer.displayGeoTiff(value.assets.thumbnail.href); Loading @@ -152,30 +143,9 @@ export function FootprintCard(props){ ); geoTiffViewer.openModal(); }; break; case "hirise": // Switch the id and date and link // props.feature.id = props.feature.properties.productid; //props.feature.properties.datetime = props.feature.properties.createdate; //modifiedProductId = props.feature.id.replace(/_RED|_COLOR/g, ''); //ThumbnailLink = 'https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/ESP/ORB_012600_012699/' + modifiedProductId + '/' + props.feature.id + '.thumb.jpg'; //BrowserLink = props.feature.properties.produrl; // set boolean pyGeoAPIFlag = true; //display different modal for PyGeo API showMetadata = (value) => () => { //geoTiffViewer.displayGeoTiff(ThumbnailLink); geoTiffViewer.changeMetaData( value.properties.datasetid, value.properties.productid, value.properties.datetime, value.links ); geoTiffViewer.openModal(); }; break; default: pyGeoAPIFlag = true; //display different modal for PyGeo API Loading @@ -187,15 +157,11 @@ export function FootprintCard(props){ value.properties.datetime, value.links ); } break; } }; break; }; const cardClick = () => { window.postMessage(["zoomFootprint", props.feature], "*"); Loading Loading @@ -247,14 +213,6 @@ export function FootprintCard(props){ <strong>ID:</strong> {props.feature.id} </div> <div className="resultSub"> {/*} <ul> {selectedOptionsWithValues.map((optionWithValues, index) => ( <li key={index}> <strong>Option:</strong> {optionWithValues.option}, <strong>Value:</strong> {optionWithValues.value} </li> ))} </ul> */} {props.feature?.properties && Object.entries(props.feature.properties).map(([key, value]) => { // Check if the key exists in the selected queryables Loading
src/components/presentational/SearchAndFilterInput.jsx +0 −3 Original line number Diff line number Diff line Loading @@ -158,13 +158,10 @@ export default function SearchAndFilterInput(props) { // retrieves all PyGEO collections const isInPyAPI = collection.filter(data => data.hasOwnProperty('itemType')); //console.log(isInPyAPI); // finds and assigns the selected collection from the PYGEO api const selectedCollection = isInPyAPI.find(data => data.title === props.selectedTitle); //console.log(selectedCollection); // retrieves all pyGEO titles const collectionTitles = isInPyAPI.map(data => data.title); Loading
src/components/presentational/Sidebar.jsx +0 −2 Original line number Diff line number Diff line Loading @@ -56,10 +56,8 @@ export default function Sidebar(props) { // Callback to update selected queryables const UpdateQueryableTitles = (selectedQueryables) => { updatedQueryableTitles = selectedQueryables; setUpdatedQueryableTitles(selectedQueryables) console.log("Selected Queryables: ", selectedQueryables); } return ( <> Loading