Use dragging flag in examples

This commit is contained in:
tsauerwein
2015-01-30 10:05:38 +01:00
parent f4500c8f89
commit b390c1bdf8
3 changed files with 9 additions and 3 deletions

View File

@@ -39,7 +39,10 @@ map.on('singleclick', function(evt) {
}
});
$(map.getViewport()).on('mousemove', function(evt) {
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
var hit = map.forEachLayerAtPixel(pixel, function(layer) {
return true;

View File

@@ -39,7 +39,10 @@ map.on('singleclick', function(evt) {
}
});
$(map.getViewport()).on('mousemove', function(evt) {
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
var hit = map.forEachLayerAtPixel(pixel, function(layer) {
return true;

View File

@@ -590,7 +590,7 @@ ol.Map.prototype.forEachFeatureAtPixel =
/**
* Detect layers that have a colour value at a pixel on the viewport, and
* Detect layers that have a color value at a pixel on the viewport, and
* execute a callback with each matching layer. Layers included in the
* detection can be configured through `opt_layerFilter`. Feature overlays will
* always be included in the detection.