Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps do not pan in Chrome 55 or Microsoft Edge #1510

Closed
dtapuska opened this issue Dec 9, 2016 · 2 comments · Fixed by #1511
Closed

Maps do not pan in Chrome 55 or Microsoft Edge #1510

dtapuska opened this issue Dec 9, 2016 · 2 comments · Fixed by #1511

Comments

@dtapuska
Copy link

dtapuska commented Dec 9, 2016

We shipped Pointer Events in Chrome 55 and discovered that this library adds pointer event listeners and touch event listeners.

I believe there are two problems with the code

  1. OpenLayers.Event.observe(element, type, this.eventHandler
    seems to add touch event listeners. Perhaps it should do something like:
            if ((touchModel === this.TOUCH_MODEL_POINTER ||
                    touchModel === this.TOUCH_MODEL_MSPOINTER) &&
                    type.indexOf('touch') === 0) {
                this.addPointerTouchListener(element, type, this.eventHandler);
            } else {
               OpenLayers.Event.observe(element, type, this.eventHandler);
            }

Instead of always adding the event handler?

  1. A touch-action: none needs to be applied to perhaps the olMapViewport
    https://github.com/openlayers/ol2/blob/master/theme/default/style.css#L8

@dracos I believe these fixes will address the issue you logged against Chromium

@dtapuska
Copy link
Author

dtapuska commented Dec 9, 2016

@NavidZ @mustaqahmed FYI

@dracos
Copy link
Contributor

dracos commented Dec 9, 2016

Oh, great, thank you! I have tested this on our use of OL2 on https://github.com/mysociety/fixmystreet and have found that I need to put the touch-action: none on olMap, not olMapViewport, for it to work (it did work on olMapViewport on the cut-down version I supplied, sorry, I’m not sure what would cause the difference) – putting it on olMapViewport led to it registering the start of a drag but then stopping after only a pixel or two movement.
I’ve put the code above in a PR at #1511, and will deploy it locally in a few minutes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants