With dramatic flourish, I'm modifying 21 files with 1033 insertions and 815 deletions between release candidates. This moves all rule subclasses to a more natural home as filter subclasses. Also adds tests for SLD write and corrects a handful of issues there. Apologies to all who lose sleep over this sort of thing. r=ahocevar,crschmidt (closes #1492)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6818 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-04-08 00:13:45 +00:00
parent d7bbcab4df
commit 1091e34c0b
18 changed files with 710 additions and 492 deletions
+19 -13
View File
@@ -31,28 +31,34 @@
// the thumbail attribute of the rss item
style = new OpenLayers.Style({externalGraphic: "${thumbnail}"});
// make the thumbnails larger when we select them
selectStyle = new OpenLayers.Style({pointRadius: 35});
// create a rule with a point symbolizer that will make the thumbnail
// larger if the title of the rss item conatins "powder"
var rule = new OpenLayers.Rule.Comparison({
type: OpenLayers.Rule.Comparison.LIKE,
var rule = new OpenLayers.Rule({
symbolizer: {pointRadius: 30},
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.LIKE,
property: "title",
value: "*powder*",
symbolizer: {"Point": {pointRadius: 30}}});
rule.value2regex("*");
value: "*powder*"
})
});
rule.filter.value2regex("*");
// If the above rule does not apply, use a smaller pointRadius.
var elseRule = new OpenLayers.Rule({
elseFilter: true,
symbolizer: {"Point": {pointRadius: 20}}});
elseFilter: true,
symbolizer: {pointRadius: 20}
});
style.addRules([rule, elseRule]);
markerLayer = new OpenLayers.Layer.Vector("", {styleMap: new OpenLayers.StyleMap({
"default": style,
"select": selectStyle})});
// Create a layer with a style map. Giving the style map keys
// for "default" and "select" rendering intent.
markerLayer = new OpenLayers.Layer.Vector("", {
styleMap: new OpenLayers.StyleMap({
"default": style,
"select": new OpenLayers.Style({pointRadius: 35})
})
});
map.addLayer(markerLayer);
// control that will show a popup when clicking on a thumbnail