[OpenLayers-Users] Can't define hover behavior on a Feature.Vector or a Layer.Vector

Diego Guidi diegoguidi at gmail.com
Mon Aug 26 04:17:22 PDT 2013


On Mon, Aug 26, 2013 at 12:19 PM, mail.roliveira at gmail.com
<mail.roliveira at gmail.com> wrote:
> If an OpenLayers.StyleMap was supported I could define a renderIntent and
> therefore maybe implement the select behaviour.

you can use the style for default in the stylemap that you can pass to
vector layer
var layer_style = new OpenLayers.StyleMap({
            "default": new
OpenLayers.Style(OpenLayers.Util.applyDefaults({... })
            "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({... })
        });

var vectorLayer = new OpenLayers.Layer.Vector("prach layer", {
styleMap: layer_style,
renderers: ['SVG', 'VML', 'Canvas']
});

Diego Guidi


More information about the Users mailing list