Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add wrapX configuration parameter

Mike McGann6acd896b9ade
diff --git a/doc/configuration.md b/doc/configuration.md
index b51ec6384..dbc28e5cb 100644
--- a/doc/configuration.md
+++ b/doc/configuration.md
@@ -117,6 +117,7 @@ The `config/wv.json/layerOrder.json` file must be updated to include the new lay
- **daynight**: Classify a layer as day or night. This information will be displayed within the title of the layer in the Measurement / Sources add modal view if provided.
- **track**: Classify a layer's track direction. This will usually be either ascending or descending and will be displayed within the title of the layer in the Measurement / Sources add modal view if provided.
- **description**: Point to a markdown file within the metadata folder to provide a layer description.
+- **wrapadjacentdays**, **wrapX**: Wrap the layer across the anti-meridian.
To display a color palette legend, a *palette* object should exist with the following properties:
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 3418bfc4d..54bc6b7d5 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -56,7 +56,7 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
lodashMerge(def, def.projections[proj.id]);
if (def.type === 'wmts') {
layer = createLayerWMTS(def, options);
- if (proj.id === 'geographic' && def.wrapadjacentdays === true) {
+ if (proj.id === 'geographic' && (def.wrapadjacentdays === true || def.wrapX)) {
layerNext = createLayerWMTS(def, options, 1);
layerPrior = createLayerWMTS(def, options, -1);
@@ -70,7 +70,7 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
}
} else if (def.type === 'vector') {
layer = createLayerVector(def, options, null);
- if (proj.id === 'geographic' && def.wrapadjacentdays === true) {
+ if (proj.id === 'geographic' && (def.wrapadjacentdays === true || def.wrapX)) {
layerNext = createLayerVector(def, options, 1);
layerPrior = createLayerVector(def, options, -1);
@@ -84,7 +84,7 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
}
} else if (def.type === 'wms') {
layer = createLayerWMS(def, options);
- if (proj.id === 'geographic' && def.wrapadjacentdays === true) {
+ if (proj.id === 'geographic' && (def.wrapadjacentdays === true || def.wrapX)) {
layerNext = createLayerWMS(def, options, 1);
layerPrior = createLayerWMS(def, options, -1);
@@ -460,7 +460,7 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
for (var i = 0, len = layers.length; i < len; i++) {
layer = layers[i];
- if (layer.wrapadjacentdays && layer.visible) {
+ if ((layer.wrapadjacentdays || layer.wrapX) && layer.visible) {
key = self.layerKey(layer, {
date: models.date[models.date.activeDate]
});
@@ -477,7 +477,7 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
layers = models.layers[models.layers.activeLayers];
for (var i = 0, len = layers.length; i < len; i++) {
layer = layers[i];
- if (layer.wrapadjacentdays && layer.visible) {
+ if ((layer.wrapadjacentdays || layer.wrapX) && layer.visible) {
key = self.layerKey(layer, {
date: models.date[models.date.activeDate]
});