Include scale in options

Add rectangle to example
Add ellipse and rectangle to rendering tests
This commit is contained in:
mike-000
2020-08-08 17:06:13 +01:00
parent 25f8b4d8d7
commit 722e0c5b69
8 changed files with 70 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -83,6 +83,25 @@ function createFeatures(stroke, fill, offSet = [0, 0]) {
})
);
vectorSource.addFeature(feature);
feature = new Feature({
geometry: new Point([8 + offSet[0], 30 + offSet[1]]),
});
// rectangle
feature.setStyle(
new Style({
image: new RegularShape({
fill: fill,
stroke: stroke,
radius: 10 / Math.SQRT2,
radius2: 10,
points: 4,
angle: 0,
scale: [1, 0.5],
}),
})
);
vectorSource.addFeature(feature);
}
createFeatures(new Stroke({width: 2}), new Fill({color: 'red'}));