Interactive interface for browsing global, full-resolution satellite imagery
Merged in palette changes with latest development branch
ZachTRice7ca865abe919
diff --cc package.jsonindex a2e5b7f6b,4097aaf4a..8999548f4--- a/package.json+++ b/package.json@@@ -1,57 -1,60 +1,60 @@@{- "version": "1.4.6",- "release": "1",- "repository": {- "type": "git",- "url": "https://github.com/nasa-gibs/worldview.git"- },- "engines": {- "node": "6.8.1"- },- "scripts": {- "test": "grunt test lint",- "start": "node ./bin/www"- },- "devDependencies": {- "babel-polyfill": "6.16.0",- "bluebird": "3.4.6",- "buster": "0.7.12",- "chromedriver": "2.25.1",- "express": "4.15.2",- "font-awesome": "4.7.0",- "geckodriver": "1.2.0",- "grunt": "0.4.x",- "grunt-buster": "0.4.x",- "grunt-contrib-clean": "1.0.x",- "grunt-contrib-coffee": "1.0.x",- "grunt-contrib-compress": "0.5.x",- "grunt-contrib-concat": "1.0.x",- "grunt-contrib-copy": "1.0.x",- "grunt-contrib-csslint": "0.2.x",- "grunt-contrib-cssmin": "1.0.x",- "grunt-contrib-jshint": "0.8.x",- "grunt-contrib-uglify": "2.0.x",- "grunt-contrib-watch": "^1.0.0",- "grunt-exec": "0.4.x",- "grunt-git-rev-parse": "0.1.x",- "grunt-line-remover": "0.0.x",- "grunt-markdown": "0.7.x",- "grunt-minjson": "0.4.x",- "grunt-mkdir": "0.1.x",- "grunt-nightwatch": "^0.5.4",- "grunt-rename": "0.1.x",- "grunt-text-replace": "0.4.x",- "jshint": "2.9.x",- "lodash": "4.15.0",- "moment": "2.13.x",- "openlayers": "4.3.1",- "gifshot": "https://github.com/nasa-gibs/gifshot/archive/4.2.0.tar.gz",- "nightwatch": "^0.9.9",- "phantomjs": "2.1.x",- "promise-queue": "2.2.3",- "react": "15.3.1",- "react-dom": "15.3.1",- "worldview-components": "1.2.0",- "selenium-server-standalone-jar": "3.0.1"- }+ "version": "1.7.0",+ "release": "1",+ "repository": {+ "type": "git",+ "url": "https://github.com/nasa-gibs/worldview.git"+ },+ "engines": {+ "node": "6.8.1"+ },+ "scripts": {+ "test": "grunt test lint",+ "start": "node ./bin/www",+ "preinstall": "node version-check.js"+ },+ "devDependencies": {+ "autoprefixer": "7.1.1",+ "babel-polyfill": "6.16.0",+ "bluebird": "3.4.6",+ "buster": "0.7.12",+ "chromedriver": "2.25.1",+ "express": "4.15.2",+ "font-awesome": "4.7.0",+ "geckodriver": "1.2.0",+ "gifshot": "https://github.com/nasa-gibs/gifshot/archive/4.2.0.tar.gz",+ "grunt": "0.4.x",+ "grunt-buster": "0.4.x",+ "grunt-contrib-clean": "1.0.x",+ "grunt-contrib-compress": "0.5.x",+ "grunt-contrib-concat": "1.0.x",+ "grunt-contrib-copy": "1.0.x",+ "grunt-contrib-cssmin": "1.0.x",+ "grunt-contrib-uglify": "2.0.x",+ "grunt-contrib-watch": "^1.0.0",+ "grunt-exec": "0.4.x",+ "grunt-git-rev-parse": "0.1.x",+ "grunt-line-remover": "0.0.x",+ "grunt-markdown": "0.7.x",+ "grunt-minjson": "0.4.x",+ "grunt-mkdir": "0.1.x",+ "grunt-nightwatch": "^0.5.4",+ "grunt-postcss": "^0.8.0",+ "grunt-rename": "0.1.x",+ "grunt-stylefmt": "^3.0.0",+ "grunt-text-replace": "0.4.x",+ "gruntify-eslint": "^4.0.0",+ "lodash": "4.15.0",+ "moment": "2.13.x",+ "nightwatch": "^0.9.9",- "openlayers": "4.0.1",++ "openlayers": "4.3.1",+ "phantomjs": "2.1.x",+ "promise-queue": "2.2.3",+ "react": "15.3.1",+ "react-dom": "15.3.1",+ "selenium-server-standalone-jar": "3.0.1",+ "stylefmt": "^6.0.0",+ "stylelint": "^8.0.0",+ "worldview-components": "1.3.3"+ }}diff --cc web/js/map/wv.map.layerbuilder.jsindex 9d405d836,ead87c4e5..e0f241495--- a/web/js/map/wv.map.layerbuilder.js+++ b/web/js/map/wv.map.layerbuilder.js@@@ -15,295 -15,302 +15,306 @@@ wv.map = wv.map || {}* @Class*/wv.map.layerbuilder = wv.map.layerbuilder || function(models, config, cache, Parent) {- var self = {};+ var self = {};- var map;- self.init = function(Parent) {- self.extentLayers = [];- Parent.events.on('selecting', hideWrap);- Parent.events.on('selectiondone', showWrap);+ var map;+ self.init = function(Parent) {- self.extentLayers = [];- Parent.events.on('selecting', hideWrap);- Parent.events.on('selectiondone', showWrap);++ self.extentLayers = [];++ Parent.events.on('selecting', hideWrap);++ Parent.events.on('selectiondone', showWrap);+ };+ /*+ * Create a new OpenLayers Layer+ *+ * @method createLayer+ * @static+ *+ * @param {object} def - Layer Specs+ *+ * @param {object} options - Layer options+ *+ *+ * @returns {object} OpenLayers layer+ */+ self.createLayer = function(def, options) {- var date, key, proj, layer, layerNext, layerPrior, group, attributes;++ var date, key, proj, layer, layerNext, layerPrior, group, attributes;+- group = null;- options = options || {};- key = self.layerKey(def, options);- proj = models.proj.selected;- layer = cache.getItem(key);- if (!layer) {- date = options.date || models.date.selected;- attributes = {- id: def.id,- key: key,- date: wv.util.toISOStringDate(date),- proj: proj.id,- def: def,- };- def = _.cloneDeep(def);- _.merge(def, def.projections[proj.id]);- if (def.type === "wmts") {- layer = createLayerWMTS(def, options);- if (proj.id === 'geographic' && def.wrapadjacentdays === true) {- layerNext = createLayerWMTS(def, options, 1);- layerPrior = createLayerWMTS(def, options, -1);++ group = null;++ options = options || {};++ key = self.layerKey(def, options);++ proj = models.proj.selected;++ layer = cache.getItem(key);++ if (!layer) {++ date = options.date || models.date.selected;++ attributes = {++ id: def.id,++ key: key,++ date: wv.util.toISOStringDate(date),++ proj: proj.id,++ def: def,+ };- /*- * Create a new OpenLayers Layer- *- * @method createLayer- * @static- *- * @param {object} def - Layer Specs- *- * @param {object} options - Layer options- *- *- * @returns {object} OpenLayers layer- */- self.createLayer = function(def, options) {- var date, key, proj, layer, layerNext, layerPrior, group, attributes;++ def = _.cloneDeep(def);++ _.merge(def, def.projections[proj.id]);++ if (def.type === "wmts") {++ layer = createLayerWMTS(def, options);++ if (proj.id === 'geographic' && def.wrapadjacentdays === true) {++ layerNext = createLayerWMTS(def, options, 1);++ layerPrior = createLayerWMTS(def, options, -1);- group = null;- options = options || {};- key = self.layerKey(def, options);- proj = models.proj.selected;- layer = cache.getItem(key);- if ( !layer ) {- date = options.date || models.date.selected;- attributes = {- id: def.id,- key: key,- date: wv.util.toISOStringDate(date),- proj: proj.id,- def: def,- };- def = _.cloneDeep(def);- _.merge(def, def.projections[proj.id]);- if ( def.type === "wmts" ) {- layer = createLayerWMTS(def, options);- if(proj.id === 'geographic' && def.wrapadjacentdays === true) {- layerNext = createLayerWMTS(def, options, 1);- layerPrior = createLayerWMTS(def, options, -1);- layer.wv = attributes;- layerPrior.wv = attributes;- layerNext.wv = attributes;++ layer.wv = attributes;++ layerPrior.wv = attributes;++ layerNext.wv = attributes;- layer.wv = attributes;- layerPrior.wv = attributes;- layerNext.wv = attributes;- layer = new ol.layer.Group({- layers: [layer, layerNext, layerPrior]- });- }++ layer = new ol.layer.Group({++ layers: [layer, layerNext, layerPrior]++ });++ }- layer = new ol.layer.Group({- layers: [layer, layerNext, layerPrior]- });- }- } else if (def.type === "wms") {- layer = createLayerWMS(def, options);- if (proj.id === 'geographic' && def.wrapadjacentdays === true) {++ } else if (def.type === "wms") {++ layer = createLayerWMS(def, options);++ if (proj.id === 'geographic' && def.wrapadjacentdays === true) {- } else if ( def.type === "wms" ) {- layer = createLayerWMS(def, options);- if(proj.id === 'geographic' && def.wrapadjacentdays === true) {- layerNext = createLayerWMS(def, options, 1);- layerPrior = createLayerWMS(def, options, -1);++ layerNext = createLayerWMS(def, options, 1);++ layerPrior = createLayerWMS(def, options, -1);- layerNext = createLayerWMS(def, options, 1);- layerPrior = createLayerWMS(def, options, -1);- layer.wv = attributes;- layerPrior.wv = attributes;- layerNext.wv = attributes;++ layer.wv = attributes;++ layerPrior.wv = attributes;++ layerNext.wv = attributes;- layer.wv = attributes;- layerPrior.wv = attributes;- layerNext.wv = attributes;- layer = new ol.layer.Group({- layers: [layer, layerNext, layerPrior]- });- }- } else {- throw new Error("Unknown layer type: " + def.type);- }- layer.wv = attributes;- cache.setItem(key, layer);- layer.setVisible(false);- }- layer.setOpacity(def.opacity || 1.0);- return layer;- };- /*- * Create a layer key- *- * @function layerKey- * @static- *- * @param {Object} def - Layer properties- *- * @param {number} options - Layer options- *- * @returns {object} layer key Object- */- self.layerKey = function(def, options) {- var layerId = def.id;- var projId = models.proj.selected.id;- var date;- if (options.date) {- date = wv.util.toISOStringDate(options.date);- } else {- date = wv.util.toISOStringDate(models.date.selected);- }- var dateId = (def.period === "daily") ? date : "";- var palette = "";- if (models.palettes.isActive(def.id)) {- palette = models.palettes.key(def.id);- }- return [layerId, projId, dateId, palette].join(":");- };- /*- * Create a new WMTS Layer- *- * @method createLayerWMTS- * @static- *- * @param {object} def - Layer Specs- *- * @param {object} options - Layer options- *- *- * @returns {object} OpenLayers WMTS layer- */- var createLayerWMTS = function(def, options, day) {- var proj, source, matrixSet, matrixIds, extra,- date, extent, start;- proj = models.proj.selected;- source = config.sources[def.source];- extent = proj.maxExtent;- start = [proj.maxExtent[0], proj.maxExtent[3]];- if (!source) {- throw new Error(def.id + ": Invalid source: " + def.source);- }- matrixSet = source.matrixSets[def.matrixSet];- if (!matrixSet) {- throw new Error(def.id + ": Undefined matrix set: " + def.matrixSet);- }- if ("undefined" === typeof def.matrixIds) {- matrixIds = [];- _.each(matrixSet.resolutions, function(resolution, index) {- matrixIds.push(index);- });- } else {- matrixIds = def.matrixIds;- }++ layer = new ol.layer.Group({++ layers: [layer, layerNext, layerPrior]++ });++ }++ } else {++ throw new Error("Unknown layer type: " + def.type);++ }++ layer.wv = attributes;++ cache.setItem(key, layer);++ layer.setVisible(false);++ }++ layer.setOpacity(def.opacity || 1.0);++ return layer;++ };++ /*++ * Create a layer key++ *++ * @function layerKey++ * @static++ *++ * @param {Object} def - Layer properties++ *++ * @param {number} options - Layer options++ *++ * @returns {object} layer key Object++ */++ self.layerKey = function(def, options) {++ var layerId = def.id;++ var projId = models.proj.selected.id;++ var date;++ if (options.date) {++ date = wv.util.toISOStringDate(options.date);++ } else {++ date = wv.util.toISOStringDate(models.date.selected);++ }++ var dateId = (def.period === "daily") ? date : "";++ var palette = "";++ if (models.palettes.isActive(def.id)) {++ palette = models.palettes.key(def.id);++ }++ return [layerId, projId, dateId, palette].join(":");++ };++ /*++ * Create a new WMTS Layer++ *++ * @method createLayerWMTS++ * @static++ *++ * @param {object} def - Layer Specs++ *++ * @param {object} options - Layer options++ *++ *++ * @returns {object} OpenLayers WMTS layer++ */++ var createLayerWMTS = function(def, options, day) {++ var proj, source, matrixSet, matrixIds, extra,++ date, extent, start;++ proj = models.proj.selected;++ source = config.sources[def.source];++ extent = proj.maxExtent;++ start = [proj.maxExtent[0], proj.maxExtent[3]];++ if (!source) {++ throw new Error(def.id + ": Invalid source: " + def.source);++ }++ matrixSet = source.matrixSets[def.matrixSet];++ if (!matrixSet) {++ throw new Error(def.id + ": Undefined matrix set: " + def.matrixSet);++ }++ if ("undefined" === typeof def.matrixIds) {++ matrixIds = [];++ _.each(matrixSet.resolutions, function(resolution, index) {++ matrixIds.push(index);++ });++ } else {++ matrixIds = def.matrixIds;++ }- layer = new ol.layer.Group({- layers: [layer, layerNext, layerPrior]- });- }- } else {- throw new Error("Unknown layer type: " + def.type);- }- layer.wv = attributes;- cache.setItem(key, layer);- layer.setVisible(false);- }- layer.setOpacity(def.opacity || 1.0);- return layer;- };- /*- * Create a layer key- *- * @function layerKey- * @static- *- * @param {Object} def - Layer properties- *- * @param {number} options - Layer options- *- * @returns {object} layer key Object- */- self.layerKey = function(def, options) {- var layerId = def.id;- var projId = models.proj.selected.id;- var date;- if ( options.date ) {- date = wv.util.toISOStringDate(options.date);- } else {- date = wv.util.toISOStringDate(models.date.selected);- }- var dateId = ( def.period === "daily" ) ? date : "";- var palette = "";- if ( models.palettes.isActive(def.id) ) {- palette = models.palettes.key(def.id);- }- return [layerId, projId, dateId, palette].join(":");- };- /*- * Create a new WMTS Layer- *- * @method createLayerWMTS- * @static- *- * @param {object} def - Layer Specs- *- * @param {object} options - Layer options- *- *- * @returns {object} OpenLayers WMTS layer- */- var createLayerWMTS = function(def, options, day) {- var proj, source, matrixSet, matrixIds, extra,- date, extent, start;- proj = models.proj.selected;- source = config.sources[def.source];- extent = proj.maxExtent;- start = [proj.maxExtent[0], proj.maxExtent[3]];- if ( !source ) {- throw new Error(def.id + ": Invalid source: " + def.source);- }- matrixSet = source.matrixSets[def.matrixSet];- if ( !matrixSet ) {- throw new Error(def.id + ": Undefined matrix set: " + def.matrixSet);- }- matrixIds = [];- _.each(matrixSet.resolutions, function(resolution, index) {- matrixIds.push(index);- });- extra = "";- if(day) {- if(day === 1){- extent = [-250, -90, -180, 90];- start = [-540,90];- } else {- extent = [180, -90, 250, 90];- start = [180,90];- }- }- if ( def.period === "daily" ) {- date = options.date || models.date.selected;- if(day) {- date = wv.util.dateAdd(date, 'day', day);- }- extra = "?TIME=" + wv.util.toISOStringDate(date);- }- var sourceOptions = {- url: source.url + extra,- layer: def.layer || def.id,- crossOrigin: "anonymous",- format: def.format,- matrixSet: matrixSet.id,- tileGrid: new ol.tilegrid.WMTS({- origin: start,- resolutions: matrixSet.resolutions,- matrixIds: matrixIds,- tileSize: matrixSet.tileSize[0],- }),- wrapX: false,- style: 'default'- };- if ( models.palettes.isActive(def.id) ) {- var lookup = models.palettes.getLookup(def.id);- sourceOptions.tileClass = ol.wv.LookupImageTile.factory(lookup);- }- var layer = new ol.layer.Tile({- extent: extent,- source: new ol.source.WMTS(sourceOptions),- });- return layer;- };- extra = "";++ extra = "";- /*- * Create a new WMS Layer- *- * @method createLayerWMTS- * @static- *- * @param {object} def - Layer Specs- *- * @param {object} options - Layer options- *- *- * @returns {object} OpenLayers WMS layer- */- var createLayerWMS = function(def, options, day) {- var proj, source, matrixSet, matrixIds, extra, transparent,- date, extent, start, bbox, res;- proj = models.proj.selected;- source = config.sources[def.source];- extent = proj.maxExtent;- start = [proj.maxExtent[0], proj.maxExtent[3]];- res = proj.resolutions;- if ( !source )- throw new Error(def.id + ": Invalid source: " + def.source);- if (day) {- if (day === 1) {- extent = [-250, -90, -180, 90];- start = [-540, 90];- } else {- extent = [180, -90, 250, 90];- start = [180, 90];- }- }++ if (day) {++ if (day === 1) {++ extent = [-250, -90, -180, 90];++ start = [-540, 90];++ } else {++ extent = [180, -90, 250, 90];++ start = [180, 90];++ }++ }- transparent = ( def.format === "image/png" );- if(proj.id === "geographic") {- res = [0.28125, 0.140625, 0.0703125, 0.03515625, 0.017578125, 0.0087890625, 0.00439453125, 0.002197265625, 0.0010986328125, 0.00054931640625, 0.00027465820313];- }- if(day) {- if(day === 1){- extent = [-250, -90, -180, 90];- start = [-540,90];- } else {- extent = [180, -90, 250, 90];- start = [180,90];- }- }- parameters = {- LAYERS: def.layer || def.id,- FORMAT: def.format,- TRANSPARENT: transparent,- VERSION: "1.1.1"- };- if ( def.styles )- parameters.STYLES = def.styles;- if (def.period === "daily") {- date = options.date || models.date.selected;- if (day) {- date = wv.util.dateAdd(date, 'day', day);- }- extra = "?TIME=" + wv.util.toISOStringDate(date);- }- var sourceOptions = {- url: source.url + extra,- layer: def.layer || def.id,- crossOrigin: "anonymous",- format: def.format,- matrixSet: matrixSet.id,- tileGrid: new ol.tilegrid.WMTS({- origin: start,- resolutions: matrixSet.resolutions,- matrixIds: matrixIds,- tileSize: matrixSet.tileSize[0],- }),- wrapX: false,- style: "undefined" === typeof def.style ? 'default' : def.style- };- if (models.palettes.isActive(def.id)) {- var lookup = models.palettes.getLookup(def.id);- sourceOptions.tileClass = ol.wv.LookupImageTile.factory(lookup);- }- var layer = new ol.layer.Tile({- extent: extent,- source: new ol.source.WMTS(sourceOptions),- });- return layer;++ if (def.period === "daily") {++ date = options.date || models.date.selected;++ if (day) {++ date = wv.util.dateAdd(date, 'day', day);++ }++ extra = "?TIME=" + wv.util.toISOStringDate(date);++ }++ var sourceOptions = {++ url: source.url + extra,++ layer: def.layer || def.id,++ crossOrigin: "anonymous",++ format: def.format,++ matrixSet: matrixSet.id,++ tileGrid: new ol.tilegrid.WMTS({++ origin: start,++ resolutions: matrixSet.resolutions,++ matrixIds: matrixIds,++ tileSize: matrixSet.tileSize[0],++ }),++ wrapX: false,++ style: "undefined" === typeof def.style ? 'default' : def.style++ };++ if (models.palettes.isActive(def.id)) {++ var lookup = models.palettes.getLookup(def.id);++ sourceOptions.tileClass = ol.wv.LookupImageTile.factory(lookup);++ }++ var layer = new ol.layer.Tile({++ extent: extent,++ source: new ol.source.WMTS(sourceOptions),++ });++ return layer;+ };- extra = "";+ /*+ * Create a new WMS Layer+ *+ * @method createLayerWMTS+ * @static+ *+ * @param {object} def - Layer Specs+ *+ * @param {object} options - Layer options+ *+ *+ * @returns {object} OpenLayers WMS layer+ */+ var createLayerWMS = function(def, options, day) {+ var proj, source, matrixSet, matrixIds, extra, transparent,+ date, extent, start, bbox, res;+ proj = models.proj.selected;+ source = config.sources[def.source];+ extent = proj.maxExtent;+ start = [proj.maxExtent[0], proj.maxExtent[3]];+ res = proj.resolutions;+ if (!source)+ throw new Error(def.id + ": Invalid source: " + def.source);- if ( def.period === "daily" ) {- date = options.date || models.date.selected;- if(day) {- date = wv.util.dateAdd(date, 'day', day);- }- extra = "?TIME=" + wv.util.toISOStringDate(date);- }- var sourceOptions = {- url: source.url + extra,- wrapX: true,- style: 'default',- crossOrigin: "anonymous",- params: parameters,- tileGrid: new ol.tilegrid.TileGrid({- origin: start,- resolutions: res- })- };- if ( models.palettes.isActive(def.id) ) {- var lookup = models.palettes.getLookup(def.id);- sourceOptions.tileClass = ol.wv.LookupImageTile.factory(lookup);- }- var layer = new ol.layer.Tile({- extent: extent,- source: new ol.source.TileWMS(sourceOptions),- });- return layer;+ transparent = (def.format === "image/png");+ if (proj.id === "geographic") {+ res = [0.28125, 0.140625, 0.0703125, 0.03515625, 0.017578125, 0.0087890625, 0.00439453125, 0.002197265625, 0.0010986328125, 0.00054931640625, 0.00027465820313];+ }+ if (day) {+ if (day === 1) {+ extent = [-250, -90, -180, 90];+ start = [-540, 90];+ } else {+ extent = [180, -90, 250, 90];+ start = [180, 90];+ }+ }+ parameters = {+ LAYERS: def.layer || def.id,+ FORMAT: def.format,+ TRANSPARENT: transparent,+ VERSION: "1.1.1"};- var hideWrap = function() {- var layer;- var key;- var layers;+ if (def.styles)+ parameters.STYLES = def.styles;- layers = models.layers.active;+ extra = "";- for(var i = 0, len = layers.length; i < len; i++) {- layer = layers[i];- if(layer.wrapadjacentdays && layer.visible) {- key = self.layerKey(layer, {date: models.date.selected});- layer = cache.getItem(key);- layer.setExtent([-180, -90, 180, 90]);- }- }+ if (def.period === "daily") {+ date = options.date || models.date.selected;+ if (day) {+ date = wv.util.dateAdd(date, 'day', day);+ }+ extra = "?TIME=" + wv.util.toISOStringDate(date);+ }++ var sourceOptions = {++ url: source.url + extra,++ wrapX: true,++ style: 'default',++ crossOrigin: "anonymous",++ params: parameters,++ tileGrid: new ol.tilegrid.TileGrid({++ origin: start,++ resolutions: res++ })+ };- var showWrap = function() {- var layer;- var layers;- var key;++ if ( models.palettes.isActive(def.id) ) {++ var lookup = models.palettes.getLookup(def.id);++ sourceOptions.tileClass = ol.wv.LookupImageTile.factory(lookup);++ }+ var layer = new ol.layer.Tile({+ extent: extent,- source: new ol.source.TileWMS({- url: source.url + extra,- wrapX: true,- style: 'default',- crossOrigin: "anonymous",- params: parameters,- tileGrid: new ol.tilegrid.TileGrid({- origin: start,- resolutions: res- })-- })++ source: new ol.source.TileWMS(sourceOptions),+ });+ return layer;+ };+ var hideWrap = function() {+ var layer;+ var key;+ var layers;- layers = models.layers.active;- for(var i = 0, len = layers.length; i < len; i++) {+ layers = models.layers.active;- layer = layers[i];- if(layer.wrapadjacentdays && layer.visible) {- key = self.layerKey(layer, {date: models.date.selected});- layer = cache.getItem(key);- layer.setExtent([-250, -90, 250, 90]);- }- }- };- self.init(Parent);- return self;+ for (var i = 0, len = layers.length; i < len; i++) {+ layer = layers[i];+ if (layer.wrapadjacentdays && layer.visible) {+ key = self.layerKey(layer, {+ date: models.date.selected+ });+ layer = cache.getItem(key);+ layer.setExtent([-180, -90, 180, 90]);+ }+ }+ };+ var showWrap = function() {+ var layer;+ var layers;+ var key;++ layers = models.layers.active;+ for (var i = 0, len = layers.length; i < len; i++) {++ layer = layers[i];+ if (layer.wrapadjacentdays && layer.visible) {+ key = self.layerKey(layer, {+ date: models.date.selected+ });+ layer = cache.getItem(key);+ layer.setExtent([-250, -90, 250, 90]);+ }+ }+ };+ self.init(Parent);+ return self;};