Skip to content

Commit

Permalink
issue/hitide-ui-42: made potential fix to image links
Browse files Browse the repository at this point in the history
  • Loading branch information
jbyrne committed Jan 29, 2024
1 parent edf2273 commit 2b4a323
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
2 changes: 0 additions & 2 deletions src/jpl/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ define([
var granuleName = obj.granuleObj["Granule-Name"];
var variableName = this.variableId;
var imageFilename = calculateImageFilename(granuleName, variableName);


var relatedUrls = obj.granuleObj.umm.RelatedUrls;
var objectURL
for(var i=0; i < relatedUrls.length; i++){
Expand Down
10 changes: 9 additions & 1 deletion src/jpl/utils/SearchDatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,24 @@ define([
return url;
}

function extractThumbnailUrl(linksArray) {
var relevantLink = linksArray.find(function (linkObject) {
return linkObject.rel === "http://esipfed.org/ns/fedsearch/1.1/browse#";
}).href
return relevantLink
}

function extractCmrDatasets(response) {
var datasets = response.feed.entry.map(function(doc) {
var docThumbnailUrl = extractThumbnailUrl(doc.links)
return {
"source": 'cmr',
"Dataset-ShortName": doc.short_name,
"Dataset-LongName": doc.title,
"Dataset-PersistentId": doc.id,
"DatasetCoverage-StartTimeLong": new Date(doc.time_start).getTime(),
"DatasetCoverage-StopTimeLong": new Date(doc.time_end).getTime(),
"Dataset-ImageUrl": "https://podaac.jpl.nasa.gov/Podaac/thumbnails/" + doc.short_name + ".jpg",
"Dataset-ImageUrl": docThumbnailUrl,
"Dataset-Description": doc.summary
}
});
Expand Down

0 comments on commit 2b4a323

Please sign in to comment.