Implement rotation for ol.style.RegularShape
This commit is contained in:
@@ -31,6 +31,7 @@ var styles = {
|
||||
stroke: stroke,
|
||||
points: 3,
|
||||
radius: 10,
|
||||
rotation: Math.PI / 4,
|
||||
angle: 0
|
||||
}))
|
||||
})],
|
||||
|
||||
@@ -5709,6 +5709,7 @@ olx.style.IconOptions.prototype.src;
|
||||
* angle: (number|undefined),
|
||||
* snapToPixel: (boolean|undefined),
|
||||
* stroke: (ol.style.Stroke|undefined),
|
||||
* rotation: (number|undefined),
|
||||
* atlasManager: (ol.style.AtlasManager|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
@@ -5757,7 +5758,7 @@ olx.style.RegularShapeOptions.prototype.radius2;
|
||||
|
||||
|
||||
/**
|
||||
* Shape's rotation in radians. A value of 0 will have one of the shape's point
|
||||
* Shape's angle in radians. A value of 0 will have one of the shape's point
|
||||
* facing up.
|
||||
* Default value is 0.
|
||||
* @type {number|undefined}
|
||||
@@ -5788,6 +5789,14 @@ olx.style.RegularShapeOptions.prototype.snapToPixel;
|
||||
olx.style.RegularShapeOptions.prototype.stroke;
|
||||
|
||||
|
||||
/**
|
||||
* Rotation in radians (positive rotation clockwise). Default is `0`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.RegularShapeOptions.prototype.rotation;
|
||||
|
||||
|
||||
/**
|
||||
* The atlas manager to use for this symbol. When using WebGL it is
|
||||
* recommended to use an atlas manager to avoid texture switching.
|
||||
|
||||
@@ -133,7 +133,7 @@ ol.style.RegularShape = function(options) {
|
||||
goog.base(this, {
|
||||
opacity: 1,
|
||||
rotateWithView: false,
|
||||
rotation: 0,
|
||||
rotation: goog.isDef(options.rotation) ? options.rotation : 0,
|
||||
scale: 1,
|
||||
snapToPixel: snapToPixel
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user