Adding point, line, polygon, text, and raster symbolizer constructors. This paves the way for rendering multiple symbolizers per rule. The SLD parser now successfully round-trips documents with multiple symbolizers and multiple FeatureTypeStyle elements (through the symbolizer zIndex property). The Style2 (yes, ack) constructor is used to represent a collection of rules with multiple symbolizers. Style2 objects are currently only used by the SLD parser if the multipleSymbolizer property is set to true. Future enhancements to the renderers can be made to account for multiple symbolizers. r=ahocevar (closes #2760).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10560 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
|
||||
function test_clone(t) {
|
||||
|
||||
t.plan(7);
|
||||
t.plan(9);
|
||||
|
||||
var rule = new OpenLayers.Rule({
|
||||
name: "test rule",
|
||||
@@ -81,6 +81,30 @@
|
||||
|
||||
rule.destroy();
|
||||
clone.destroy();
|
||||
|
||||
// test multiple symbolizers
|
||||
rule = new OpenLayers.Rule({
|
||||
name: "test rule",
|
||||
minScaleDenominator: 10,
|
||||
maxScaleDenominator: 20,
|
||||
filter: new OpenLayers.Filter.Comparison({
|
||||
type: OpenLayers.Filter.Comparison.EQUAL_TO,
|
||||
property: "prop",
|
||||
value: "value"
|
||||
}),
|
||||
symbolizers: [
|
||||
new OpenLayers.Symbolizer.Line({
|
||||
strokeColor: "black"
|
||||
})
|
||||
]
|
||||
});
|
||||
clone = rule.clone();
|
||||
|
||||
t.eq(clone.symbolizers.length, 1, "clone has one symbolizer");
|
||||
t.ok(clone.symbolizers[0] !== rule.symbolizers[0], "clone has different symbolizers than original");
|
||||
|
||||
clone.destroy();
|
||||
rule.destroy();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user