Add ol.style.stroke.equals

This commit is contained in:
Tom Payne
2013-11-07 15:43:31 +01:00
parent 9a11cb87aa
commit 1d06cee93d

View File

@@ -1,6 +1,7 @@
goog.provide('ol.style.DefaultStyleFunction');
goog.provide('ol.style.Style');
goog.provide('ol.style.StyleFunction');
goog.provide('ol.style.stroke');
goog.require('goog.functions');
@@ -28,6 +29,18 @@ ol.style.Image;
ol.style.Stroke;
/**
* @param {ol.style.Stroke} strokeStyle1 Stroke style 1.
* @param {ol.style.Stroke} strokeStyle2 Stroke style 2.
* @return {boolean} Equals.
*/
ol.style.stroke.equals = function(strokeStyle1, strokeStyle2) {
return strokeStyle1 === strokeStyle2 || (
strokeStyle1.color == strokeStyle2.color &&
strokeStyle1.width == strokeStyle2.width);
};
/**
* @typedef {{fill: ol.style.Fill,
* image: ol.style.Image,