do not scale displacement

This commit is contained in:
mike-000
2022-08-11 21:31:48 +01:00
parent c327740108
commit 4bc0ce0f03
7 changed files with 88 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -11,7 +11,7 @@ import View from '../../../../src/ol/View.js';
import {Icon} from '../../../../src/ol/style.js';
const vectorSource = new VectorSource();
function createFeatures(stroke, fill, offSet = [0, 0]) {
function createFeatures(stroke, fill, offSet = [0, 0], scale = 1) {
let feature;
feature = new Feature({
geometry: new Point([offSet[0], offSet[1]]),
@@ -26,6 +26,7 @@ function createFeatures(stroke, fill, offSet = [0, 0]) {
radius: 10,
angle: Math.PI / 4,
displacement: [-15, 15],
scale: scale,
}),
}),
new Style({
@@ -36,6 +37,7 @@ function createFeatures(stroke, fill, offSet = [0, 0]) {
anchorXUnits: 'fraction',
anchorYUnits: 'fraction',
displacement: [-15, 15],
scale: scale,
}),
}),
]);
@@ -131,6 +133,14 @@ createFeatures(
null,
[-50, -50]
);
createFeatures(
new Stroke({
lineDash: [10, 5],
}),
null,
[-50, 50],
1.5
);
createFeatures(new Stroke(), new Fill(), [50, -50]);