Interactive interface for browsing global, full-resolution satellite imagery
WV-1244 Added Zots
Taylor Gunnoe43cd7c9ffb54
diff --git a/web/css/bank.css b/web/css/bank.cssindex 4eed44209..ebf5d6bfd 100644--- a/web/css/bank.css+++ b/web/css/bank.css@@ -116,7 +116,13 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', e#selectorboxcontent a:hover { color: #88f; }/* HACK : End */-.bank li.item h4 {font-size:0.85em; padding:0 3px;}+.bank li.item h4 {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space:nowrap;+ font-size:0.85em;+ padding:0 3px;+}.bank li.item p {padding:0 3px; color:#222; font-size:0.78em; font-style:italic;}.bank li.item span.palette {display:block; overflow:hidden; margin-top:5px; margin-left:5px;}.bank li.item ul.palette li {float:left;}diff --git a/web/css/wv.sidebar.css b/web/css/wv.sidebar.cssindex 5385abfcd..4ec968f3c 100644--- a/web/css/wv.sidebar.css+++ b/web/css/wv.sidebar.css@@ -123,6 +123,28 @@ i.wv-layers-options-icon{.productsitem.layer-hidden a.wv-layers-options:hover i.wv-layers-options-icon{background-position: 0 -69px;}+.productsitem div.zot {+ margin-left: 31px;+ position: absolute;+ top: 0;+ bottom: 0;+ width: 10px;+ background: #ccc;+ display:none;+}+.productsitem div.zot b {+ text-align: center;+ height: 20px;+ line-height: 20px;+ position: absolute;+ top: 50%;+ left: 0;+ right: 0;+ margin-top: -10px;+}+.productsitem.zotted div.zot{+ display: block;+}.productsitem a.button.close {display:block;float:right;@@ -130,8 +152,6 @@ i.wv-layers-options-icon{height:20px;position:relative;cursor:pointer;--}.bank li.item.productsitem:hover a.button.close{display:block;@@ -166,8 +186,9 @@ i.wv-layers-options-icon{margin-left:31px;cursor:default;min-height:40px;--+}+.productsitem.zotted .layer-main{+ margin-left: 42px;}.productsitem.layer-hidden .layer-main, .productsitem.layer-hidden a.hdanchor {background:rgba(255, 255, 255, 0.2);diff --git a/web/js/date/wv.date.timeline.js b/web/js/date/wv.date.timeline.jsindex 9424d4bae..7ff2a8e39 100644--- a/web/js/date/wv.date.timeline.js+++ b/web/js/date/wv.date.timeline.js@@ -232,6 +232,8 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {self.data.set();});+ console.log(ui.map);+};init();diff --git a/web/js/date/wv.date.timeline.zoom.js b/web/js/date/wv.date.timeline.zoom.jsindex 14f2340ad..c8094a152 100644--- a/web/js/date/wv.date.timeline.zoom.js+++ b/web/js/date/wv.date.timeline.zoom.js@@ -54,6 +54,9 @@ wv.date.timeline.zoom = wv.date.timeline.zoom || function(models, config, ui) {zoom = 3;}+ console.log(this);+ console.log(zoom);+ console.log(event);tl.config.zoom.call(this, zoom, event);};diff --git a/web/js/layers/wv.layers.active.js b/web/js/layers/wv.layers.active.jsindex 33abb7dd6..1108b2635 100644--- a/web/js/layers/wv.layers.active.js+++ b/web/js/layers/wv.layers.active.js@@ -54,6 +54,8 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {resize();}});++ ui.map.selected.getView().on("change:resolution", onZoomChange);};var render = function() {@@ -145,7 +147,6 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {.attr("id", "hide" + encodeURIComponent(layer.id)).attr("data-layer", layer.id);-var $visibleImage = $("<i></i>").on('click', function(){$visibleButton.trigger('click');@@ -155,6 +156,12 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {$visibleButton.append($visibleImage);$layer.append($visibleButton);+ var $zot = $("<div></div>")+ .addClass('zot')+ .append('<b>!</b>');++ $layer.append($zot);+if ( !layer.visible ) {$visibleButton.attr("title", "Show Layer")@@ -203,7 +210,7 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {var $mainLayerDiv = $('<div></div>').addClass('layer-main').attr("data-layer", layer.id)- .append($('<h4></h4>').html(names.title))+ .append($('<h4></h4>').html(names.title).attr('title',names.title)).append($('<p></p>').html(names.subtitle));@@ -425,6 +432,51 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {setTimeout(render, 1);};+ var onZoomChange = function() {+ var map = ui.map;+ var zoom = map.selected.getView().getZoom();+ console.log(zoom);+ var sources = config.sources;+ var proj = models.proj.selected.id;++ _.each(model.active, function(layer){+ var matrixSet = layer.projections[proj].matrixSet;+ if(matrixSet !== undefined){+ var source = layer.projections[proj].source;+ var zoomLimit = sources[source]+ .matrixSets[matrixSet]+ .resolutions.length - 1;++ if( zoom > zoomLimit)+ addZot(layer.id);+ else removeZot(layer.id);++ console.log(layer.id + ' ' + zoomLimit);+ }+ });++ };++ var removeZot = function(layer){+ var layerPane = ui.activeLayers.selector;+ var $layer = $(layerPane + ' li.productsitem[data-layer="' + layer + '"]');+ if($layer.hasClass('zotted'))+ $layer.removeClass('zotted');+ else {+ return;+ }+ };+ var addZot = function(layer){+ var layerPane = ui.activeLayers.selector;+ var $layer = $(layerPane + ' li.productsitem[data-layer="' + layer + '"]');+ if($layer.hasClass('zotted'))+ return;+ else {+ $layer.addClass('zotted');++ }+ };+init();return self;};diff --git a/web/js/map/wv.map.ui.js b/web/js/map/wv.map.ui.jsindex 65fe3fd91..bf8743134 100644--- a/web/js/map/wv.map.ui.js+++ b/web/js/map/wv.map.ui.js@@ -33,7 +33,7 @@ wv.map.ui = wv.map.ui || function(models, config) {var map = createMap(proj);self.proj[proj.id] = map;});-+models.proj.events.on("select", function() {updateProjection();});