Don't store private functions and variables into RasterSource

This commit is contained in:
Frederic Junod
2017-12-22 09:29:45 +01:00
parent fd84f9378e
commit 259ecd0f79
8 changed files with 81 additions and 88 deletions

View File

@@ -2,7 +2,7 @@
import Map from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import RasterSource from '../src/ol/source/Raster.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
@@ -100,7 +100,7 @@ function xyz2rgb(x) {
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
}
var raster = new _ol_source_Raster_({
var raster = new RasterSource({
sources: [new _ol_source_Stamen_({
layer: 'watercolor',
transition: 0

View File

@@ -5,7 +5,7 @@ import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import TileLayer from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import RasterSource from '../src/ol/source/Raster.js';
var minVgi = 0;
var maxVgi = 0.25;
@@ -59,7 +59,7 @@ var bing = new _ol_source_BingMaps_({
* Create a raster source where pixels with VGI values above a threshold will
* be colored green.
*/
var raster = new _ol_source_Raster_({
var raster = new RasterSource({
sources: [bing],
/**
* Run calculations on pixel data.

View File

@@ -5,7 +5,7 @@ import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import RasterSource from '../src/ol/source/Raster.js';
function growRegion(inputs, data) {
var image = inputs[0];
@@ -78,7 +78,7 @@ var imagery = new TileLayer({
source: new _ol_source_BingMaps_({key: key, imagerySet: 'Aerial'})
});
var raster = new _ol_source_Raster_({
var raster = new RasterSource({
sources: [imagery.getSource()],
operationType: 'image',
operation: growRegion,

View File

@@ -4,7 +4,7 @@ import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import RasterSource from '../src/ol/source/Raster.js';
import _ol_source_XYZ_ from '../src/ol/source/XYZ.js';
function flood(pixels, data) {
@@ -30,7 +30,7 @@ var elevation = new _ol_source_XYZ_({
transition: 0
});
var raster = new _ol_source_Raster_({
var raster = new RasterSource({
sources: [elevation],
operation: flood
});

View File

@@ -4,7 +4,7 @@ import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import TileLayer from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import RasterSource from '../src/ol/source/Raster.js';
import _ol_source_XYZ_ from '../src/ol/source/XYZ.js';
@@ -108,7 +108,7 @@ var elevation = new _ol_source_XYZ_({
transition: 0
});
var raster = new _ol_source_Raster_({
var raster = new RasterSource({
sources: [elevation],
operationType: 'image',
operation: shade