When I applied style rules to my "vector" layer, OpenLayers.Control.SelectFeature no longer shows the feature as selected. I have tried adding selection to the style:
var style = new OpenLayers.Style({"select":{fillColor: "#66ccff",strokeColor: "#3399ff"}});
The rule:
var zone1 = new OpenLayers.Rule(
{
filter: new OpenLayers.Filter.Comparison(
{
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "zone",
value: "zone1",
}),
symbolizer: {pointRadius: 10, fillColor: "green", fillOpacity: 0.5, strokeColor: "black", label: "${zone}",labelOutlineColor: "black",labelOutlineWidth: 3, fontColor: "white",
fontSize: "8"}
});
Rule applied to the style:
style.addRules([zone1]);
The selection worked fine until I added the rules.
Any ideas?