@longline/aqua-ui 1.0.164 → 1.0.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -136,8 +136,14 @@ var InterpolationLayerBase = function (props) {
|
|
|
136
136
|
if (!gl)
|
|
137
137
|
return;
|
|
138
138
|
var geometry = getGeometry();
|
|
139
|
-
var minValue =
|
|
140
|
-
var maxValue =
|
|
139
|
+
var minValue = Infinity;
|
|
140
|
+
var maxValue = -Infinity;
|
|
141
|
+
var len = geometry.features.length;
|
|
142
|
+
while (len--) {
|
|
143
|
+
var value = geometry.features[len].properties['a'];
|
|
144
|
+
minValue = value < minValue ? value : minValue;
|
|
145
|
+
maxValue = value > maxValue ? value : maxValue;
|
|
146
|
+
}
|
|
141
147
|
createLevelsProgram(gl);
|
|
142
148
|
createContoursProgram(gl);
|
|
143
149
|
createTexture(gl);
|
|
@@ -111,8 +111,14 @@ var ParticlesLayerBase = function (props) {
|
|
|
111
111
|
}));
|
|
112
112
|
var polys = tin(points, 'v');
|
|
113
113
|
// Find min and max values in GeoJSON:
|
|
114
|
-
var minValue =
|
|
115
|
-
var maxValue =
|
|
114
|
+
var minValue = Infinity;
|
|
115
|
+
var maxValue = -Infinity;
|
|
116
|
+
var len = polys.features.length;
|
|
117
|
+
while (len--) {
|
|
118
|
+
var value = polys.features[len].properties['a'];
|
|
119
|
+
minValue = value < minValue ? value : minValue;
|
|
120
|
+
maxValue = value > maxValue ? value : maxValue;
|
|
121
|
+
}
|
|
116
122
|
// Convert dataset to triangle geometry.
|
|
117
123
|
// Result is a list of v1,v2,v3, v1,v2,v3, ...
|
|
118
124
|
// where each vector has (x,y,value).
|