Merge pull request #11537 from mike-000/patch-16
Add rotation and rotateWithView to ol/style/Circle clone method and options
This commit is contained in:
@@ -12,6 +12,10 @@ import RegularShape from './RegularShape.js';
|
||||
* @property {Array<number>} [displacement=[0,0]] displacement
|
||||
* @property {number|import("../size.js").Size} [scale=1] Scale. A two dimensional scale will produce an ellipse.
|
||||
* Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for `radius`.
|
||||
* @property {number} [rotation=0] Rotation in radians
|
||||
* (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).
|
||||
* @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view
|
||||
* (meaningful only when used in conjunction with a two dimensional scale).
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -32,6 +36,9 @@ class CircleStyle extends RegularShape {
|
||||
radius: options.radius,
|
||||
stroke: options.stroke,
|
||||
scale: options.scale !== undefined ? options.scale : 1,
|
||||
rotation: options.rotation !== undefined ? options.rotation : 0,
|
||||
rotateWithView:
|
||||
options.rotateWithView !== undefined ? options.rotateWithView : false,
|
||||
displacement:
|
||||
options.displacement !== undefined ? options.displacement : [0, 0],
|
||||
});
|
||||
@@ -49,6 +56,8 @@ class CircleStyle extends RegularShape {
|
||||
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
|
||||
radius: this.getRadius(),
|
||||
scale: Array.isArray(scale) ? scale.slice() : scale,
|
||||
rotation: this.getRotation(),
|
||||
rotateWithView: this.getRotateWithView(),
|
||||
displacement: this.getDisplacement().slice(),
|
||||
});
|
||||
style.setOpacity(this.getOpacity());
|
||||
|
||||
Reference in New Issue
Block a user