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:
@@ -59,8 +59,10 @@ info.tooltip({
|
||||
animation: false,
|
||||
trigger: 'manual'
|
||||
});
|
||||
map.on(['click', 'mousemove'], function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
|
||||
// FIXME support touch devices
|
||||
$(map.getViewport()).on('mousemove', function(evt) {
|
||||
var pixel = map.getEventPixel(evt.originalEvent);
|
||||
info.css({
|
||||
left: pixel[0] + 'px',
|
||||
top: (pixel[1] - 15) + 'px'
|
||||
|
||||
Reference in New Issue
Block a user