From 22fa0e305a91eddb61aefd41fdbe61ba1326b106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 20 Nov 2013 14:41:14 +0100 Subject: [PATCH] Add ol.style.Image constructor --- src/ol/style/imagestyle.js | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/ol/style/imagestyle.js diff --git a/src/ol/style/imagestyle.js b/src/ol/style/imagestyle.js new file mode 100644 index 0000000000..867b4e9f20 --- /dev/null +++ b/src/ol/style/imagestyle.js @@ -0,0 +1,49 @@ +// FIXME export ol.style.Image +// FIXME decide default value for snapToPixel + +goog.provide('ol.style.Image'); + + +/** + * @typedef {{anchor: Array., + * image: (HTMLCanvasElement|HTMLVideoElement|Image), + * rotation: number, + * snapToPixel: (boolean|undefined), + * subtractViewRotation: boolean}} + */ +ol.style.ImageOptions; + + + +/** + * @constructor + * @param {ol.style.ImageOptions} options Options. + */ +ol.style.Image = function(options) { + + /** + * @type {Array.} + */ + this.anchor = options.anchor; + + /** + * @type {HTMLCanvasElement|HTMLVideoElement|Image} + */ + this.image = options.image; + + /** + * @type {number} + */ + this.rotation = options.rotation; + + /** + * @type {boolean|undefined} + */ + this.snapToPixel = options.snapToPixel; + + /** + * @type {boolean} + */ + this.subtractViewRotation = options.subtractViewRotation; + +};