From d82f1f8e02bbd14737a6a98e97edb2343d1fb3a0 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 19 Dec 2013 15:28:44 +0100 Subject: [PATCH] Add scale to ol.style.IconStyle --- src/objectliterals.jsdoc | 1 + src/ol/style/iconstyle.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 959f6a2349..0c3e6aaa76 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -735,6 +735,7 @@ * @typedef {Object} olx.style.IconOptions * @property {ol.Pixel|undefined} anchor Anchor. * @property {null|string|undefined} crossOrigin crossOrigin setting for image. + * @property {number|undefined} scale Scale. * @property {number|undefined} rotation Rotation. * @property {ol.Size|undefined} size Icon size in pixel. * @property {string} src Image source URI. diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index 96b312ee92..c4df241a40 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -83,10 +83,16 @@ ol.style.Icon = function(opt_options) { */ var rotation = goog.isDef(options.rotation) ? options.rotation : 0; + /** + * @type {number} + */ + var scale = goog.isDef(options.scale) ? options.scale : 1; + goog.base(this, { anchor: anchor, imageState: ol.style.ImageState.IDLE, rotation: rotation, + scale: scale, size: size, snapToPixel: undefined, subtractViewRotation: false