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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user