This commit is contained in:
Tim Schaub
2013-06-12 21:42:12 -06:00
parent 5e309e244b
commit bd5d9d572e
4 changed files with 36 additions and 22 deletions

View File

@@ -95,17 +95,23 @@ ol.style.Polygon = function(options) {
if (goog.isDefAndNotNull(options.strokeColor) ||
goog.isDefAndNotNull(options.strokeWidth)) {
strokeColor = !goog.isDefAndNotNull(options.strokeColor) ?
new ol.expression.Literal(ol.style.PolygonDefaults.strokeColor) :
(options.strokeColor instanceof ol.expression.Expression) ?
options.strokeColor :
new ol.expression.Literal(options.strokeColor);
if (goog.isDefAndNotNull(options.strokeColor)) {
strokeColor = (options.strokeColor instanceof ol.expression.Expression) ?
options.strokeColor :
new ol.expression.Literal(options.strokeColor);
} else {
strokeColor = new ol.expression.Literal(
/** @type {string} */ (ol.style.PolygonDefaults.strokeColor));
}
strokeWidth = !goog.isDef(options.strokeWidth) ?
new ol.expression.Literal(ol.style.PolygonDefaults.strokeWidth) :
(options.strokeWidth instanceof ol.expression.Expression) ?
options.strokeWidth :
new ol.expression.Literal(options.strokeWidth);
if (goog.isDefAndNotNull(options.strokeWidth)) {
strokeWidth = (options.strokeWidth instanceof ol.expression.Expression) ?
options.strokeWidth :
new ol.expression.Literal(options.strokeWidth);
} else {
strokeWidth = new ol.expression.Literal(
/** @type {number} */ (ol.style.PolygonDefaults.strokeWidth));
}
}
/**

View File

@@ -130,17 +130,24 @@ ol.style.Shape = function(options) {
if (goog.isDefAndNotNull(options.strokeColor) ||
goog.isDefAndNotNull(options.strokeWidth)) {
strokeColor = !goog.isDefAndNotNull(options.strokeColor) ?
new ol.expression.Literal(ol.style.ShapeDefaults.strokeColor) :
(options.strokeColor instanceof ol.expression.Expression) ?
options.strokeColor :
new ol.expression.Literal(options.strokeColor);
if (goog.isDefAndNotNull(options.strokeColor)) {
strokeColor = (options.strokeColor instanceof ol.expression.Expression) ?
options.strokeColor :
new ol.expression.Literal(options.strokeColor);
} else {
strokeColor = new ol.expression.Literal(
/** @type {string} */ (ol.style.ShapeDefaults.strokeColor));
}
if (goog.isDefAndNotNull(options.strokeWidth)) {
strokeWidth = (options.strokeWidth instanceof ol.expression.Expression) ?
options.strokeWidth :
new ol.expression.Literal(options.strokeWidth);
} else {
strokeWidth = new ol.expression.Literal(
/** @type {number} */ (ol.style.ShapeDefaults.strokeWidth));
}
strokeWidth = !goog.isDef(options.strokeWidth) ?
new ol.expression.Literal(ol.style.ShapeDefaults.strokeWidth) :
(options.strokeWidth instanceof ol.expression.Expression) ?
options.strokeWidth :
new ol.expression.Literal(options.strokeWidth);
}
/**