I want to get some pointer events like
- long tap
- right click
Are there any examples or documentations for archive them?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI want to get some pointer events like
Are there any examples or documentations for archive them?
I found the solution by myself for long tap:
var longpress = false;
map.on("click",function(e){
(longpress) ? alert("Long Press") : alert("Short Press");
console.log(map.getEventCoordinate(e.pixel));
});
var startTime, endTime;
map.on('pointerdown', function () {
startTime = new Date().getTime();
});
map.on('pointerup', function () {
endTime = new Date().getTime();
console.log(endTime - startTime);
longpress = (endTime - startTime < 500) ? false : true;
});