cannot draw a label with value 0, r=fredj (closes #3258)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user