Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added missing code from ol.wv namespace for colormap thresholds (cherry picked from commit ac41f4f)

Edmond Lee69137ab01722
diff --git a/web/ext/map/openlayers-3.6.0.wv1/ol-debug.js b/web/ext/map/openlayers-3.6.0.wv1/ol-debug.js
index e484fa899..908c38b12 100644
--- a/web/ext/map/openlayers-3.6.0.wv1/ol-debug.js
+++ b/web/ext/map/openlayers-3.6.0.wv1/ol-debug.js
@@ -117282,6 +117282,97 @@ ol.style.RegularShape.prototype.getChecksum = function() {
return this.checksums_[0];
};
+/*
+ * NASA Worldview
+ *
+ * This code was originally developed at NASA/Goddard Space Flight Center for
+ * the Earth Science Data and Information System (ESDIS) project.
+ *
+ * Copyright (C) 2013 - 2015 United States Government as represented by the
+ * Administrator of the National Aeronautics and Space Administration.
+ * All Rights Reserved.
+ */
+
+goog.provide('ol.wv');
+goog.provide('ol.wv.LookupImageTile');
+goog.require('ol.ImageTile');
+
+/**
+ * @constructor
+ * @extends {ol.ImageTile}
+ */
+ol.wv.LookupImageTile = function(lookup, tileCoord, state, src, crossOrigin, tileLoadFunction) {
+
+ goog.base(this, tileCoord, state, src, "anonymous", tileLoadFunction);
+
+ /**
+ * @private
+ */
+ this.lookup_ = lookup;
+
+ /**
+ * @private
+ */
+ this.canvas_ = null;
+};
+goog.inherits(ol.wv.LookupImageTile, ol.ImageTile);
+
+/**
+ * @return (HTMLCanvasElement|HTMLImageElement|HTMLVideoElement|null)
+ */
+ol.wv.LookupImageTile.prototype.getImage = function(opt_context) {
+ return this.canvas_;
+};
+
+ol.wv.LookupImageTile.prototype.load = function() {
+
+ if ( this.state === ol.TileState.IDLE ) {
+ this.state = ol.TileState.LOADING;
+ var that = this;
+ this.image_.addEventListener("load", function() {
+ that.canvas_ = document.createElement("canvas");
+ that.canvas_.width = that.image_.width;
+ that.canvas_.height = that.image_.height;
+ var octets = that.canvas_.width * that.canvas_.height * 4;
+ var g = that.canvas_.getContext("2d");
+ g.drawImage(that.image_, 0, 0);
+ var imageData = g.getImageData(0, 0, that.canvas_.width,
+ that.canvas_.height);
+ var pixels = imageData.data;
+
+ for ( var i = 0; i < octets; i += 4 ) {
+ var source = pixels[i + 0] + "," +
+ pixels[i + 1] + "," +
+ pixels[i + 2] + "," +
+ pixels[i + 3];
+ var target = that.lookup_[source];
+
+ if ( target ) {
+ pixels[i + 0] = target["r"];
+ pixels[i + 1] = target["g"];
+ pixels[i + 2] = target["b"];
+ pixels[i + 3] = target["a"];
+ }
+ }
+ g.putImageData(imageData, 0, 0);
+ that.state = ol.TileState.LOADED;
+ that.changed();
+ });
+ this.image_.src = this.src_;
+ };
+
+};
+
+/**
+ * @api
+ */
+ol.wv.LookupImageTile.factory = function(lookup) {
+ return function(tileCoord, state, src, crossOrigin, tileLoadFunction) {
+ return new ol.wv.LookupImageTile(lookup, tileCoord, state, src,
+ crossOrigin, tileLoadFunction);
+ };
+};
+
// Copyright 2009 The Closure Library Authors.
// All Rights Reserved.
//
@@ -117511,6 +117602,8 @@ goog.require('ol.tilegrid.WMTS');
goog.require('ol.tilegrid.Zoomify');
goog.require('ol.tilejson');
goog.require('ol.webgl.Context');
+goog.require('ol.wv');
+goog.require('ol.wv.LookupImageTile');
goog.require('ol.xml');
@@ -118524,6 +118617,11 @@ goog.exportProperty(
'setZoom',
ol.View.prototype.setZoom);
+goog.exportSymbol(
+ 'ol.wv.LookupImageTile.factory',
+ ol.wv.LookupImageTile.factory,
+ OPENLAYERS);
+
goog.exportSymbol(
'ol.xml.getAllTextContent',
ol.xml.getAllTextContent,
@@ -121414,6 +121512,21 @@ goog.exportProperty(
'unByKey',
ol.Object.prototype.unByKey);
+goog.exportProperty(
+ ol.wv.LookupImageTile.prototype,
+ 'state',
+ ol.wv.LookupImageTile.prototype.state);
+
+goog.exportProperty(
+ ol.wv.LookupImageTile.prototype,
+ 'changed',
+ ol.wv.LookupImageTile.prototype.changed);
+
+goog.exportProperty(
+ ol.wv.LookupImageTile.prototype,
+ 'getTileCoord',
+ ol.wv.LookupImageTile.prototype.getTileCoord);
+
goog.exportProperty(
ol.Collection.prototype,
'get',