cannot draw a label with value 0, r=fredj (closes #3258)

This commit is contained in:
Bart van den Eijnden
2011-09-23 14:44:23 +02:00
parent 8bcbb069b5
commit 807b0eabaa
2 changed files with 3 additions and 3 deletions

View File

@@ -191,7 +191,7 @@ OpenLayers.Style = OpenLayers.Class({
style.display = "none";
}
if (style.label && typeof style.label !== "string") {
if (style.label != null && typeof style.label !== "string") {
style.label = String(style.label);
}

View File

@@ -176,9 +176,9 @@
// c) test that label in returned symbolizer is a string even if property value is a number
var symbolizer = style.createSymbolizer(
new OpenLayers.Feature.Vector(null, {foo: "bar", labelValue: 10})
new OpenLayers.Feature.Vector(null, {foo: "bar", labelValue: 0})
);
t.eq(symbolizer.label, "10", "c) feature property cast to string when used as symbolizer label");
t.eq(symbolizer.label, "0", "c) feature property cast to string when used as symbolizer label");
}