Use jQuery to listen to map mousemove in examples

This commit also removes the click listener, which was used for touch devices. The click listener will be added back when the lib will correctly handle clicks on touch devices.
This commit is contained in:
Éric Lemoine
2013-10-17 14:35:33 +02:00
parent 938f45a032
commit fe3440a83d
8 changed files with 23 additions and 10 deletions

View File

@@ -64,9 +64,11 @@ var map = new ol.Map({
})
});
map.on(['click', 'mousemove'], function(evt) {
// FIXME support touch devices
$(map.getViewport()).on('mousemove', function(evt) {
var pixel = map.getEventPixel(evt.originalEvent);
map.getFeatures({
pixel: evt.getPixel(),
pixel: pixel,
layers: [vector],
success: function(featuresByLayer) {
var features = featuresByLayer[0];