Vector examples display feature info on click again
This commit is contained in:
@@ -64,9 +64,7 @@ var map = new ol.Map({
|
||||
})
|
||||
});
|
||||
|
||||
// FIXME support touch devices
|
||||
$(map.getViewport()).on('mousemove', function(evt) {
|
||||
var pixel = map.getEventPixel(evt.originalEvent);
|
||||
var displayFeatureInfo = function(pixel) {
|
||||
map.getFeatures({
|
||||
pixel: pixel,
|
||||
layers: [vector],
|
||||
@@ -77,4 +75,14 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
' ';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(map.getViewport()).on('mousemove', function(evt) {
|
||||
var pixel = map.getEventPixel(evt.originalEvent);
|
||||
displayFeatureInfo(pixel);
|
||||
});
|
||||
|
||||
map.on('click', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user