Add opacity property to ol.style.Image
This commit is contained in:
@@ -69,6 +69,7 @@ ol.style.Circle = function(opt_options) {
|
|||||||
this.size_ = [size, size];
|
this.size_ = [size, size];
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
opacity: 1,
|
||||||
rotation: 0,
|
rotation: 0,
|
||||||
scale: 1,
|
scale: 1,
|
||||||
snapToPixel: undefined,
|
snapToPixel: undefined,
|
||||||
|
|||||||
@@ -72,6 +72,11 @@ ol.style.Icon = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.size_ = goog.isDef(options.size) ? options.size : null;
|
this.size_ = goog.isDef(options.size) ? options.size : null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
var opacity = goog.isDef(options.opacity) ? options.opacity : 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
@@ -83,6 +88,7 @@ ol.style.Icon = function(opt_options) {
|
|||||||
var scale = goog.isDef(options.scale) ? options.scale : 1;
|
var scale = goog.isDef(options.scale) ? options.scale : 1;
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
opacity: opacity,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
scale: scale,
|
scale: scale,
|
||||||
snapToPixel: undefined,
|
snapToPixel: undefined,
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ ol.style.ImageState = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{rotation: number,
|
* @typedef {{opacity: number,
|
||||||
|
* rotation: number,
|
||||||
* scale: number,
|
* scale: number,
|
||||||
* snapToPixel: (boolean|undefined),
|
* snapToPixel: (boolean|undefined),
|
||||||
* subtractViewRotation: boolean}}
|
* subtractViewRotation: boolean}}
|
||||||
@@ -31,6 +32,12 @@ ol.style.ImageOptions;
|
|||||||
*/
|
*/
|
||||||
ol.style.Image = function(options) {
|
ol.style.Image = function(options) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.opacity_ = options.opacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@@ -58,6 +65,14 @@ ol.style.Image = function(options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {number} Opacity.
|
||||||
|
*/
|
||||||
|
ol.style.Image.prototype.getOpacity = function() {
|
||||||
|
return this.opacity_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {number} Rotation.
|
* @return {number} Rotation.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user