It is possible to change the color of highlightCtrl when I use onselectedHover? Default is light blue.
I want to change it to another one eg. red? Does anyone know where this value is defined?
It is possible to change the color of highlightCtrl when I use onselectedHover? Default is light blue.
I want to change it to another one eg. red? Does anyone know where this value is defined?
When you define your layer you could specify your styleMaps as well:
_layer = new OpenLayers.Layer.Vector("My Layer Name", {
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
strokeColor: "#ff0000",
strokeOpacity: .7,
strokeWidth: 1,
fillColor: "#ff0000",
fillOpacity: 0,
cursor: "pointer"
}),
"temporary": new OpenLayers.Style({
strokeColor: "#ffff33",
strokeOpacity: .9,
strokeWidth: 2,
fillColor: "#ffff33",
fillOpacity: .3,
cursor: "pointer"
}),
"select": new OpenLayers.Style({
strokeColor: "#0033ff",
strokeOpacity: .7,
strokeWidth: 2,
fillColor: "#0033ff",
fillOpacity: 0,
graphicZIndex: 2,
cursor: "pointer"
})
})
});
Then specify your renderintent
:
_highlightControl = new OpenLayers.Control.SelectFeature(layer, {
hover: true,
highlightOnly: true,
renderIntent: "temporary"
});
The other way is to edit directly the style.css archive in the ol/Theme/default directory of your Openlayers library. Look for this code and edit it:
.olHandlerBoxSelectFeature {
border: 2px solid blue;
position: absolute;
background-color: white;
opacity: 0.50;
font-size: 1px;
filter: alpha(opacity=50);}
Hope this will be useful to you.