Fixing OpenLayers.Style.createLiteral to work with all strings. r=ahocevar (closes #1439)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6553 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-03-19 19:23:15 +00:00
parent 410cd22976
commit 3cc419aada
2 changed files with 42 additions and 1 deletions

View File

@@ -331,7 +331,7 @@ OpenLayers.Style = OpenLayers.Class({
OpenLayers.Style.createLiteral = function(value, context, feature) {
if (typeof value == "string" && value.indexOf("${") != -1) {
value = OpenLayers.String.format(value, context, [feature]);
value = isNaN(value) ? value : parseFloat(value);
value = (isNaN(value) || !value) ? value : parseFloat(value);
}
return value;
}