Export ol.Object#dispatchEvent ? #851

fredj opened this Issue Jul 2, 2013 · 2 comments

2 participants

OpenLayers member

What I'm trying to do is a context menu that can be activated on acontextmenu event or (on touch device) after a long press.

The context menu handler:

map.on('contextmenu', function(event) {
  // something useful here

On touch devices, the contextmenu is manually triggered:

var holdTimeout;
map.on('touchstart', function(event) {
  holdTimeout = window.setTimeout(function() {
    // trigger a 'contextmenu' event using the touchstart event
    event.type = 'contextmenu';
  }, 750);
map.on(['touchmove', 'touchend'], function(event) {

Is it the right direction?

See https://github.com/fredj/ol3/compare/contextmenu


@fredj, is this still needed?

OpenLayers member

no, can be closed

@fredj fredj closed this Mar 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment