diff --git a/CHANGELOG.md b/CHANGELOG.md index b1bb5b85..6c76ab50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Added global_grid configuration check to make a global extent for images. ### Changed ### Removed ### Fixed diff --git a/src/hitideConfig.js b/src/hitideConfig.js index befd159a..43686899 100644 --- a/src/hitideConfig.js +++ b/src/hitideConfig.js @@ -1,7 +1,7 @@ var hitideProfileOrigin = "https://hitide.profile.podaac.uat.earthdatacloud.nasa.gov/hitide/api"; window.hitideConfig = { - paletteService: "https://hitide.podaac.uat.earthdatacloud.nasa.gov/palettes", + paletteService: "https://hitide.podaac.earthdatacloud.nasa.gov/palettes", cmrDatasetSearchService: hitideProfileOrigin + "/cmr/search/collections.json?tool_name=HiTIDE", cmrGranuleSearchService: hitideProfileOrigin + "/cmr/search/granules.umm_json", @@ -25,4 +25,4 @@ window.hitideConfig = { maxGranulesPerDownload: 999999999, googleTagManagerId: "GTM-M5D83V6", earthDataAppClientId: "dxpH2WeN_f8IpNLgHwplsg" -}; \ No newline at end of file +}; diff --git a/src/jpl/dijit/LayerControl.js b/src/jpl/dijit/LayerControl.js index ba592c32..bef1c596 100644 --- a/src/jpl/dijit/LayerControl.js +++ b/src/jpl/dijit/LayerControl.js @@ -23,10 +23,11 @@ define([ "dijit/form/HorizontalRule", "dijit/form/HorizontalRuleLabels", "jpl/dijit/ui/AlertDialog", - "jpl/config/Config" + "jpl/config/Config", + "esri/geometry/Extent" ], function(declare, lang, on, domConstruct, domClass, domAttr, domStyle, topic, touch, xhr, array, _WidgetBase, _TemplatedMixin, template, css, Layers, LayerEvent, MapEvent, MapUtil, AnimationUtil, - HorizontalSlider, HorizontalRule, HorizontalRuleLabels, AlertDialog, Config) { + HorizontalSlider, HorizontalRule, HorizontalRuleLabels, AlertDialog, Config, Extent) { return declare([_WidgetBase, _TemplatedMixin], { templateString: template, widgetsInTemplate: false, @@ -256,14 +257,33 @@ 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++){ objectURL = relatedUrls[i]['URL']; if(objectURL.includes(imageFilename)){ - return MapUtil.prototype.createMapImage(objectURL, this.translateExtent(obj.granuleObj["Granule-Extent"])); + var currentExtent = this.translateExtent(obj.granuleObj["Granule-Extent"]) + + // Calculate the new extent properties based on the offset + var newExtent = new Extent({ + xmin: currentExtent.xmin , + ymin: currentExtent.ymin , + xmax: currentExtent.xmax , + ymax: currentExtent.ymax , + spatialReference: currentExtent.spatialReference + }); + + if(obj['global_grid'] === true){ + newExtent = new Extent({ + xmin: -180 , + ymin: -90 , + xmax: 180 , + ymax: 90 , + spatialReference: currentExtent.spatialReference + }); + } + + return MapUtil.prototype.createMapImage(objectURL, newExtent); } } } diff --git a/src/jpl/dijit/LegendsAndOpacity.js b/src/jpl/dijit/LegendsAndOpacity.js index 704386e9..d3c05cf0 100644 --- a/src/jpl/dijit/LegendsAndOpacity.js +++ b/src/jpl/dijit/LegendsAndOpacity.js @@ -93,7 +93,6 @@ define([ if (this.datasets[message.datasetId]) { this.removeDataset(message); } - var laoDataset = new LegendsAndOpacityDataset({ _id: Math.random(), datasetId: message.datasetId, @@ -159,6 +158,9 @@ define([ this.open = false; }, handleVariablesFetched: function(message) { + if('global_grid' in message){ + this.datasets[message.datasetId]['global_grid'] = message['global_grid']; + } if('multi_lon_lat' in message){ var new_variables = []; for(var i = 0; i < message.multi_groups.length; i++){ @@ -193,6 +195,7 @@ define([ }, handleAddGranulePreview: function(message) { var laoDataset = this.datasets[message.granuleObj["Granule-DatasetId"]]; + message['global_grid'] = laoDataset['global_grid']; if (laoDataset) { laoDataset.addGranulePreview(message); }