forked from openlayers/openlayers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rendering test for rotated image vector clipping with intersection
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.69 KB
rendering/cases/layer-vectorimage-extent-rotation-intersection/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions
72
rendering/cases/layer-vectorimage-extent-rotation-intersection/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import Feature from '../../../src/ol/Feature.js'; | ||
import Map from '../../../src/ol/Map.js'; | ||
import Point from '../../../src/ol/geom/Point.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 {Fill, RegularShape, Stroke, Style} from '../../../src/ol/style.js'; | ||
import {fromExtent} from '../../../src/ol/geom/Polygon.js'; | ||
|
||
const extent = [ | ||
1900e3 - 100000, | ||
6300e3 - 100000, | ||
1900e3 + 100000, | ||
6300e3 + 100000, | ||
]; | ||
|
||
const pt1 = new Feature({ | ||
name: 'point', | ||
geometry: new Point([1900e3, 6300e3]), | ||
}); | ||
pt1.setStyle( | ||
new Style({ | ||
image: new RegularShape({ | ||
points: 4, | ||
radius: 20, | ||
fill: new Fill({ | ||
color: 'fuchsia', | ||
}), | ||
}), | ||
}) | ||
); | ||
|
||
const border = new Feature({ | ||
name: 'extent border', | ||
geometry: fromExtent(extent), | ||
}); | ||
|
||
new Map({ | ||
layers: [ | ||
new VectorImageLayer({ | ||
style: new Style({ | ||
stroke: new Stroke({ | ||
color: 'yellow', | ||
width: 20, | ||
}), | ||
}), | ||
source: new VectorSource({ | ||
features: [border], | ||
}), | ||
}), | ||
new VectorImageLayer({ | ||
style: new Style({ | ||
stroke: new Stroke({ | ||
color: 'green', | ||
width: 20, | ||
}), | ||
}), | ||
source: new VectorSource({ | ||
features: [pt1, border], | ||
}), | ||
extent: extent, | ||
}), | ||
], | ||
target: 'map', | ||
view: new View({ | ||
center: [1900e3, 6300e3], | ||
zoom: 7, | ||
rotation: Math.PI / 4, | ||
}), | ||
}); | ||
|
||
render(); |