Skip to content

How easy is it to add support for a 'hover' interaction? #97

@Infiniverse

Description

@Infiniverse

Hi there,

We have many many features on screen. The default selection interaction requires the user to be pixel perfect when selecting a feature. It's clear that OpenLayers can do better than that.

One example is outlined here:

http://plnkr.co/edit/zbqKeJ4lXQ8C60TC4fza?p=preview

They've defined an hover selection criteria which highlights features as the mouse passes over them, which makes it much easier for a user to select exactly the feature that they want to work on.

var hoverInteraction = new ol.interaction.Select({
    condition: ol.events.condition.pointerMove,
    layers: [layerFeatures, layerFeatures2]
});
map.addInteraction(hoverInteraction);

var featureOverlay = new ol.FeatureOverlay({
    map: map,
    style: geometryStyle
});

hoverInteraction.on('select', function(evt){
    if(evt.selected.length > 0){
        console.info('selected: ' + evt.selected[0].getId());
    }
});

I'd like to introduce a similar method into v-ol3, but I'm struggling to see how it might be supported (given that my gwt foo is far from perfect).

Could you please offer me some suggestions, or pointers as to what might be the most appropriate way to extend v-ol3 to incorporate a similar method please?

Cheers,
Joe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions