Use string instead of ol.structs.Checksum

This commit is contained in:
tsauerwein
2014-12-04 11:48:43 +01:00
parent 6d1d47a918
commit 0fd1a575a9
5 changed files with 15 additions and 21 deletions
-6
View File
@@ -1,12 +1,6 @@
goog.provide('ol.structs.IHasChecksum'); goog.provide('ol.structs.IHasChecksum');
/**
* @typedef {string}
*/
ol.structs.Checksum;
/** /**
* @interface * @interface
+1 -1
View File
@@ -29,7 +29,7 @@ ol.style.Circle = function(opt_options) {
/** /**
* @private * @private
* @type {Array.<ol.structs.Checksum>|null} * @type {Array.<string>}
*/ */
this.checksums_ = null; this.checksums_ = null;
+4 -4
View File
@@ -26,9 +26,9 @@ ol.style.Fill = function(opt_options) {
/** /**
* @private * @private
* @type {?ol.structs.Checksum} * @type {string|undefined}
*/ */
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -49,7 +49,7 @@ ol.style.Fill.prototype.getColor = function() {
*/ */
ol.style.Fill.prototype.setColor = function(color) { ol.style.Fill.prototype.setColor = function(color) {
this.color_ = color; this.color_ = color;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -57,7 +57,7 @@ ol.style.Fill.prototype.setColor = function(color) {
* @inheritDoc * @inheritDoc
*/ */
ol.style.Fill.prototype.getChecksum = function() { ol.style.Fill.prototype.getChecksum = function() {
if (goog.isNull(this.checksum_)) { if (!goog.isDef(this.checksum_)) {
this.checksum_ = 'f' + (!goog.isNull(this.color_) ? this.checksum_ = 'f' + (!goog.isNull(this.color_) ?
ol.color.asString(this.color_) : '-'); ol.color.asString(this.color_) : '-');
} }
+1 -1
View File
@@ -28,7 +28,7 @@ ol.style.RegularShape = function(opt_options) {
/** /**
* @private * @private
* @type {Array.<ol.structs.Checksum>|null} * @type {Array.<string>}
*/ */
this.checksums_ = null; this.checksums_ = null;
+9 -9
View File
@@ -61,9 +61,9 @@ ol.style.Stroke = function(opt_options) {
/** /**
* @private * @private
* @type {?ol.structs.Checksum} * @type {string|undefined}
*/ */
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -129,7 +129,7 @@ ol.style.Stroke.prototype.getWidth = function() {
*/ */
ol.style.Stroke.prototype.setColor = function(color) { ol.style.Stroke.prototype.setColor = function(color) {
this.color_ = color; this.color_ = color;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -141,7 +141,7 @@ ol.style.Stroke.prototype.setColor = function(color) {
*/ */
ol.style.Stroke.prototype.setLineCap = function(lineCap) { ol.style.Stroke.prototype.setLineCap = function(lineCap) {
this.lineCap_ = lineCap; this.lineCap_ = lineCap;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -153,7 +153,7 @@ ol.style.Stroke.prototype.setLineCap = function(lineCap) {
*/ */
ol.style.Stroke.prototype.setLineDash = function(lineDash) { ol.style.Stroke.prototype.setLineDash = function(lineDash) {
this.lineDash_ = lineDash; this.lineDash_ = lineDash;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -165,7 +165,7 @@ ol.style.Stroke.prototype.setLineDash = function(lineDash) {
*/ */
ol.style.Stroke.prototype.setLineJoin = function(lineJoin) { ol.style.Stroke.prototype.setLineJoin = function(lineJoin) {
this.lineJoin_ = lineJoin; this.lineJoin_ = lineJoin;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -177,7 +177,7 @@ ol.style.Stroke.prototype.setLineJoin = function(lineJoin) {
*/ */
ol.style.Stroke.prototype.setMiterLimit = function(miterLimit) { ol.style.Stroke.prototype.setMiterLimit = function(miterLimit) {
this.miterLimit_ = miterLimit; this.miterLimit_ = miterLimit;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -189,7 +189,7 @@ ol.style.Stroke.prototype.setMiterLimit = function(miterLimit) {
*/ */
ol.style.Stroke.prototype.setWidth = function(width) { ol.style.Stroke.prototype.setWidth = function(width) {
this.width_ = width; this.width_ = width;
this.checksum_ = null; this.checksum_ = undefined;
}; };
@@ -197,7 +197,7 @@ ol.style.Stroke.prototype.setWidth = function(width) {
* @inheritDoc * @inheritDoc
*/ */
ol.style.Stroke.prototype.getChecksum = function() { ol.style.Stroke.prototype.getChecksum = function() {
if (goog.isNull(this.checksum_)) { if (!goog.isDef(this.checksum_)) {
var raw = 's' + var raw = 's' +
(!goog.isNull(this.color_) ? (!goog.isNull(this.color_) ?
ol.color.asString(this.color_) : '-') + ',' + ol.color.asString(this.color_) : '-') + ',' +