Disable opacity transition for raster source sources

This commit is contained in:
ahocevar
2019-04-17 17:38:50 -07:00
parent 251fc79484
commit 887d8e8a90
4 changed files with 4 additions and 8 deletions

View File

@@ -100,8 +100,7 @@ function xyz2rgb(x) {
const raster = new RasterSource({
sources: [new Stamen({
layer: 'watercolor',
transition: 0
layer: 'watercolor'
})],
operation: function(pixels, data) {
const hcl = rgb2hcl(pixels[0]);

View File

@@ -24,8 +24,7 @@ function flood(pixels, data) {
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
const elevation = new XYZ({
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
crossOrigin: 'anonymous',
transition: 0
crossOrigin: 'anonymous'
});
const raster = new RasterSource({

View File

@@ -100,8 +100,7 @@ function shade(inputs, data) {
const elevation = new XYZ({
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
crossOrigin: 'anonymous',
transition: 0
crossOrigin: 'anonymous'
});
const raster = new Raster({

View File

@@ -288,8 +288,7 @@ class RasterSource extends ImageSource {
frameState.focus = center;
frameState.size[0] = Math.round(getWidth(extent) / resolution);
frameState.size[1] = Math.round(getHeight(extent) / resolution);
frameState.time = Date.now();
frameState.animate = false;
frameState.time = Infinity;
const viewState = frameState.viewState;
viewState.center = center;