Merge pull request #9442 from ahocevar/raster-no-transition
Disable opacity transition for raster source sources
This commit is contained in:
@@ -100,8 +100,7 @@ function xyz2rgb(x) {
|
|||||||
|
|
||||||
const raster = new RasterSource({
|
const raster = new RasterSource({
|
||||||
sources: [new Stamen({
|
sources: [new Stamen({
|
||||||
layer: 'watercolor',
|
layer: 'watercolor'
|
||||||
transition: 0
|
|
||||||
})],
|
})],
|
||||||
operation: function(pixels, data) {
|
operation: function(pixels, data) {
|
||||||
const hcl = rgb2hcl(pixels[0]);
|
const hcl = rgb2hcl(pixels[0]);
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ function flood(pixels, data) {
|
|||||||
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
||||||
const elevation = new XYZ({
|
const elevation = new XYZ({
|
||||||
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
|
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous'
|
||||||
transition: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const raster = new RasterSource({
|
const raster = new RasterSource({
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ function shade(inputs, data) {
|
|||||||
|
|
||||||
const elevation = new XYZ({
|
const elevation = new XYZ({
|
||||||
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
|
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous'
|
||||||
transition: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const raster = new Raster({
|
const raster = new Raster({
|
||||||
|
|||||||
@@ -288,8 +288,7 @@ class RasterSource extends ImageSource {
|
|||||||
frameState.focus = center;
|
frameState.focus = center;
|
||||||
frameState.size[0] = Math.round(getWidth(extent) / resolution);
|
frameState.size[0] = Math.round(getWidth(extent) / resolution);
|
||||||
frameState.size[1] = Math.round(getHeight(extent) / resolution);
|
frameState.size[1] = Math.round(getHeight(extent) / resolution);
|
||||||
frameState.time = Date.now();
|
frameState.time = Infinity;
|
||||||
frameState.animate = false;
|
|
||||||
|
|
||||||
const viewState = frameState.viewState;
|
const viewState = frameState.viewState;
|
||||||
viewState.center = center;
|
viewState.center = center;
|
||||||
|
|||||||
Reference in New Issue
Block a user