Accept string as color input

This commit is contained in:
Alexandre Brault
2015-12-04 17:54:37 -05:00
parent 5c70d37da6
commit 3f16b340fc
3 changed files with 5 additions and 5 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ goog.require('ol.Feature');
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.Overlay'); goog.require('ol.Overlay');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.color');
goog.require('ol.geom.Point'); goog.require('ol.geom.Point');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
@@ -24,7 +23,7 @@ var iconStyle = new ol.style.Style({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
anchorYUnits: 'pixels', anchorYUnits: 'pixels',
color: ol.color.asArray('#8959A8'), color: '#8959A8',
opacity: 0.75, opacity: 0.75,
src: 'data/icon.png' src: 'data/icon.png'
})) }))
+2 -2
View File
@@ -6040,7 +6040,7 @@ olx.style.FillOptions.prototype.color;
* anchorOrigin: (ol.style.IconOrigin|undefined), * anchorOrigin: (ol.style.IconOrigin|undefined),
* anchorXUnits: (ol.style.IconAnchorUnits|undefined), * anchorXUnits: (ol.style.IconAnchorUnits|undefined),
* anchorYUnits: (ol.style.IconAnchorUnits|undefined), * anchorYUnits: (ol.style.IconAnchorUnits|undefined),
* color: (ol.Color|undefined), * color: (ol.Color|string|undefined),
* crossOrigin: (null|string|undefined), * crossOrigin: (null|string|undefined),
* img: (Image|HTMLCanvasElement|undefined), * img: (Image|HTMLCanvasElement|undefined),
* offset: (Array.<number>|undefined), * offset: (Array.<number>|undefined),
@@ -6097,7 +6097,7 @@ olx.style.IconOptions.prototype.anchorYUnits;
/** /**
* Color to tint the icon. If not specified, the icon will be left as is. * Color to tint the icon. If not specified, the icon will be left as is.
* @type {ol.Color|undefined} * @type {ol.Color|string|undefined}
* @api * @api
*/ */
olx.style.IconOptions.prototype.color; olx.style.IconOptions.prototype.color;
+2 -1
View File
@@ -129,7 +129,8 @@ ol.style.Icon = function(opt_options) {
/** /**
* @type {ol.Color} * @type {ol.Color}
*/ */
var color = options.color !== undefined ? options.color : null; var color = options.color !== undefined ? ol.color.asArray(options.color) :
null;
/** /**
* @private * @private