Add scale to ol.style.Image

This commit is contained in:
Tom Payne
2013-12-19 15:28:15 +01:00
parent 2a6979e15a
commit 9524a46f41
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -52,6 +52,7 @@ ol.style.Circle = function(opt_options) {
anchor: [size / 2, size / 2], anchor: [size / 2, size / 2],
imageState: ol.style.ImageState.LOADED, imageState: ol.style.ImageState.LOADED,
rotation: 0, rotation: 0,
scale: 1,
size: [size, size], size: [size, size],
snapToPixel: undefined, snapToPixel: undefined,
subtractViewRotation: false subtractViewRotation: false
+15
View File
@@ -22,6 +22,7 @@ ol.style.ImageState = {
* @typedef {{anchor: ol.Pixel, * @typedef {{anchor: ol.Pixel,
* imageState: ol.style.ImageState, * imageState: ol.style.ImageState,
* rotation: number, * rotation: number,
* scale: number,
* size: ol.Size, * size: ol.Size,
* snapToPixel: (boolean|undefined), * snapToPixel: (boolean|undefined),
* subtractViewRotation: boolean}} * subtractViewRotation: boolean}}
@@ -57,6 +58,12 @@ ol.style.Image = function(options) {
*/ */
this.rotation_ = options.rotation; this.rotation_ = options.rotation;
/**
* @private
* @type {number}
*/
this.scale_ = options.scale;
/** /**
* @protected * @protected
* @type {ol.Size} * @type {ol.Size}
@@ -111,6 +118,14 @@ ol.style.Image.prototype.getRotation = function() {
}; };
/**
* @return {number} Scale.
*/
ol.style.Image.prototype.getScale = function() {
return this.scale_;
};
/** /**
* @return {ol.Size} Size. * @return {ol.Size} Size.
*/ */