Merge pull request #13226 from tschaub/gl-wrap-x
Support the wrapX option for WebGL rendered tile sources
This commit is contained in:
@@ -100,7 +100,9 @@ function getRenderExtent(frameState, extent) {
|
|||||||
const source =
|
const source =
|
||||||
/** {import("../../source/Tile.js").default} */ layerState.layer.getSource();
|
/** {import("../../source/Tile.js").default} */ layerState.layer.getSource();
|
||||||
if (!source.getWrapX()) {
|
if (!source.getWrapX()) {
|
||||||
const gridExtent = source.tileGrid.getExtent();
|
const gridExtent = source
|
||||||
|
.getTileGridForProjection(frameState.viewState.projection)
|
||||||
|
.getExtent();
|
||||||
if (gridExtent) {
|
if (gridExtent) {
|
||||||
extent = getIntersection(extent, gridExtent);
|
extent = getIntersection(extent, gridExtent);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
@@ -0,0 +1,27 @@
|
|||||||
|
import Map from '../../../../src/ol/Map.js';
|
||||||
|
import TileLayer from '../../../../src/ol/layer/WebGLTile.js';
|
||||||
|
import View from '../../../../src/ol/View.js';
|
||||||
|
import XYZ from '../../../../src/ol/source/XYZ.js';
|
||||||
|
|
||||||
|
document.getElementById('map').style.background = 'green';
|
||||||
|
|
||||||
|
new Map({
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
source: new XYZ({
|
||||||
|
url: '/data/tiles/satellite/{z}/{x}/{y}.jpg',
|
||||||
|
transition: 0,
|
||||||
|
wrapX: false,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
target: 'map',
|
||||||
|
view: new View({
|
||||||
|
center: [15700000, 2700000],
|
||||||
|
zoom: 2,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
render({
|
||||||
|
message: 'data tiles outside the world are not rendered',
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user