Merge pull request #11193 from mike-000/patch-14

Fix VectorImage layer clipping with rotation
This commit is contained in:
Andreas Hocevar
2020-06-24 17:23:43 +02:00
committed by GitHub
3 changed files with 27 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,26 @@
import GeoJSON from '../../../src/ol/format/GeoJSON.js';
import Map from '../../../src/ol/Map.js';
import VectorImageLayer from '../../../src/ol/layer/VectorImage.js';
import VectorSource from '../../../src/ol/source/Vector.js';
import View from '../../../src/ol/View.js';
import {transformExtent} from '../../../src/ol/proj.js';
new Map({
target: 'map',
view: new View({
center: [0, 0],
zoom: 1,
rotation: Math.PI / 4,
}),
layers: [
new VectorImageLayer({
extent: transformExtent([-50, -45, 50, 45], 'EPSG:4326', 'EPSG:3857'),
source: new VectorSource({
url: '/data/countries.json',
format: new GeoJSON(),
}),
}),
],
});
render();

View File

@@ -115,6 +115,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
{},
frameState,
{
coordinateToPixelTransform: create(),
declutterItems: [],
extent: renderedExtent,
size: [width, height],