Restore pointerMove in condition.js and example.
Wrongly removed on previous commit as pointed by @ahocevar.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {click, altKeyOnly} from '../src/ol/events/condition.js';
|
||||
import {click, pointerMove, altKeyOnly} from '../src/ol/events/condition.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
@@ -39,9 +39,7 @@ const selectClick = new Select({
|
||||
|
||||
// select interaction working on "pointermove"
|
||||
const selectPointerMove = new Select({
|
||||
condition: function(mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == 'pointermove';
|
||||
}
|
||||
condition: pointerMove
|
||||
});
|
||||
|
||||
const selectAltClick = new Select({
|
||||
|
||||
@@ -110,6 +110,19 @@ export const mouseActionButton = function(mapBrowserEvent) {
|
||||
export const never = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* Return `true` if the browser event is a `pointermove` event, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the browser event is a `pointermove` event.
|
||||
* @api
|
||||
*/
|
||||
export const pointerMove = function(mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == 'pointermove';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Return `true` if the event is a map `singleclick` event, `false` otherwise.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user