2

I am using mousemove event to do some code when the mouse get over features, the code below is working well with IE and firefox but It is not working with chrome

$(this.map.getViewport()).on('mousemove', function(evt) {
    var feature = map.forEachFeatureAtPixel(map.getEventPixel(evt),
        function(feature, layer) {
            return feature;
        });
    if (feature) {
        //do my code
    } else {
        don't do anything
    }
});

any suggestion?

closed as off-topic by PolyGeo Nov 12 '14 at 9:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What isn't working exactly? And do you you have any errors in developer console in chrome? – John Powell Nov 6 '14 at 15:45
  • No I don't have any errors. The event mousemove is not fired in chrome, but it is fired in firefox. it may be jquery issue – Mariam Malak Nov 6 '14 at 16:21
  • This problem is solved, I just restart my machine. I think I must to clean chrome cache – Mariam Malak Nov 12 '14 at 8:20