Simplify raster sources by working with a single operation

This commit is contained in:
Tim Schaub
2015-08-03 09:31:17 -06:00
parent f2f5cd2630
commit 860fdabd76
9 changed files with 138 additions and 113 deletions
+3 -3
View File
@@ -81,7 +81,7 @@ function shade(inputs, data) {
aspect = Math.atan2(dzdy, -dzdx);
if (aspect < 0) {
aspect = halfPi - aspect;
} else if (aspect > Math.PI / 2) {
} else if (aspect > halfPi) {
aspect = twoPi - aspect + halfPi;
} else {
aspect = halfPi - aspect;
@@ -99,7 +99,7 @@ function shade(inputs, data) {
}
}
return [new ImageData(shadeData, width, height)];
return new ImageData(shadeData, width, height);
}
var elevation = new ol.source.XYZ({
@@ -110,7 +110,7 @@ var elevation = new ol.source.XYZ({
var raster = new ol.source.Raster({
sources: [elevation],
operationType: 'image',
operations: [shade]
operation: shade
});
var map = new ol.Map({