Merge pull request #7637 from marcjansen/named-exports-color

Named exports from the ol/color module
This commit is contained in:
Marc Jansen
2017-12-19 17:11:03 +01:00
committed by GitHub
11 changed files with 95 additions and 108 deletions

View File

@@ -2,7 +2,7 @@
* @module ol/style/Fill
*/
import {getUid} from '../index.js';
import _ol_color_ from '../color.js';
import {asString} from '../color.js';
/**
* @classdesc
@@ -76,8 +76,7 @@ _ol_style_Fill_.prototype.getChecksum = function() {
) {
this.checksum_ = getUid(this.color_).toString();
} else {
this.checksum_ = 'f' + (this.color_ ?
_ol_color_.asString(this.color_) : '-');
this.checksum_ = 'f' + (this.color_ ? asString(this.color_) : '-');
}
}

View File

@@ -4,7 +4,7 @@
import {getUid, inherits} from '../index.js';
import ImageState from '../ImageState.js';
import {assert} from '../asserts.js';
import _ol_color_ from '../color.js';
import {asArray} from '../color.js';
import _ol_events_ from '../events.js';
import EventType from '../events/EventType.js';
import IconAnchorUnits from '../style/IconAnchorUnits.js';
@@ -101,8 +101,7 @@ var _ol_style_Icon_ = function(opt_options) {
* @private
* @type {ol.Color}
*/
this.color_ = options.color !== undefined ? _ol_color_.asArray(options.color) :
null;
this.color_ = options.color !== undefined ? asArray(options.color) : null;
/**
* @private

View File

@@ -1,7 +1,7 @@
/**
* @module ol/style/IconImageCache
*/
import _ol_color_ from '../color.js';
import {asString} from '../color.js';
/**
* Singleton class. Available through {@link ol.style.iconImageCache}.
@@ -36,7 +36,7 @@ var IconImageCache = function() {
* @return {string} Cache key.
*/
function getKey(src, crossOrigin, color) {
var colorString = color ? _ol_color_.asString(color) : 'null';
var colorString = color ? asString(color) : 'null';
return crossOrigin + ':' + src + ':' + colorString;
}