@planet/dynamic-tiles
Advanced tools
Comparing version 1.0.0-beta3 to 1.0.0-beta4
18
maths.js
@@ -101,5 +101,7 @@ "use strict"; | ||
function computeRanges(histogram) { | ||
var minAlloc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5; | ||
var loThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5; | ||
var hiThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5; | ||
var bandRanges = []; | ||
var allocThreshold = Math.floor(minAlloc / 100 * histogram.cnt); | ||
var loAllocThreshold = Math.floor(loThreshold / 100 * histogram.cnt); | ||
var hiAllocThreshold = Math.floor(hiThreshold / 100 * histogram.cnt); | ||
@@ -109,3 +111,4 @@ for (var b = 0, bb = histogram.length; b < bb; b++) { | ||
var high = null; | ||
var alloc = 0; | ||
var hiAlloc = 0; | ||
var loAlloc = 0; | ||
var bandLen = histogram[b].length; | ||
@@ -116,7 +119,6 @@ | ||
if (histogram[b][i] > 0) { | ||
alloc += histogram[b][i]; | ||
loAlloc += histogram[b][i]; | ||
if (alloc > allocThreshold) { | ||
if (loAlloc > loAllocThreshold) { | ||
low = i; | ||
alloc = 0; | ||
} | ||
@@ -128,5 +130,5 @@ } | ||
if (histogram[b][_i] > 0) { | ||
alloc += histogram[b][_i]; | ||
hiAlloc += histogram[b][_i]; | ||
if (alloc > allocThreshold) { | ||
if (hiAlloc > hiAllocThreshold) { | ||
high = _i; | ||
@@ -133,0 +135,0 @@ } |
@@ -106,3 +106,2 @@ "use strict"; | ||
args.tileLoadFunction = function (tile, src) { | ||
// configureNumpyTile(tile); | ||
tile.bands = _this.getBands(); | ||
@@ -327,3 +326,3 @@ _this.loading_ = true; | ||
key: "getHistogram", | ||
value: function getHistogram(view) { | ||
value: function getHistogram(view, partial) { | ||
var _this4 = this; | ||
@@ -334,3 +333,3 @@ | ||
// return the new histogram | ||
if (!_this4.loading_) { | ||
if (!_this4.loading_ || partial === true) { | ||
resolve(_this4.calculateHistogram(view)); | ||
@@ -337,0 +336,0 @@ } else { |
{ | ||
"name": "@planet/dynamic-tiles", | ||
"version": "1.0.0-beta3", | ||
"version": "1.0.0-beta4", | ||
"description": "Support for dynamically colored tiles from Planet Inc. tile servers.", | ||
@@ -5,0 +5,0 @@ "main": "./ol.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50080
1149