Disable image smoothing for the DEM source

This commit is contained in:
mike-000
2019-12-18 20:40:20 +00:00
committed by GitHub
parent 2b45bc054e
commit 977b89c99d

View File

@@ -22,9 +22,15 @@ 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'
const elevation = new TileLayer({
source: new XYZ({
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
crossOrigin: 'anonymous'
})
});
elevation.on('prerender', function(evt) {
evt.context.imageSmoothingEnabled = false;
evt.context.msImageSmoothingEnabled = false;
});
const raster = new RasterSource({