Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

IE10/11 Unknown touch event error #5

Closed
magnusvikstrom opened this issue Dec 7, 2015 · 7 comments
Closed

IE10/11 Unknown touch event error #5

magnusvikstrom opened this issue Dec 7, 2015 · 7 comments

Comments

@magnusvikstrom
Copy link

On IE10 and 11 the map fails to load with following error:

Unknown touch event type

Steps to reproduce:
Open http://angular-ui.github.io/ui-leaflet-draw/ in IE10/11

Since it works in regular Leaflet.draw I believe its an issue with ui-leaflet-draw

@mikeyc7m
Copy link

i've hit this issue too, everything was working fine until recently.
looks like microsoft have added touchcancel and touchleave events which the code chokes on.

@nmccready
Copy link
Contributor

Is it ui-leaflet-draw or is it leaflet-draw itself? All the events and touch are handled by leaflet-draw. Take it up to them and then I'll bump the version.

@alexkb
Copy link

alexkb commented Apr 15, 2016

@nmccready I think it's something to do with ui-leaflet-draw. If you look at the Leaflet.draw demo in IE11, it renders and works fine.

@alexkb
Copy link

alexkb commented Apr 15, 2016

There's another thread about this issue by @micahiverson over in Leaflet/Leaflet#4168. It's a bit hacky, but simply calling the existing addPointerListernEnd() function on these IE events, seems to fix things for me in IE11:

addPointerListener: function (obj, type, handler, id) {

    switch (type) {
    case 'touchstart':
        return this.addPointerListenerStart(obj, type, handler, id);
    case 'touchend':
        return this.addPointerListenerEnd(obj, type, handler, id);
    case 'touchmove':
        return this.addPointerListenerMove(obj, type, handler, id);
    case 'touchcancel':
        return this.addPointerListenerEnd(obj, type, handler, id);
    case 'touchleave':
        return this.addPointerListenerEnd(obj, type, handler, id);
    default:
        throw 'Unknown touch event type';
    }
},

@alexkb
Copy link

alexkb commented May 6, 2016

I've just upgraded from leaflet-draw 0.2.4 to 0.3.0 and the previous "Unknown touch event" error seems to have been fixed without the need for the addPointerListener touch events hack above.

@AnasELMALEKI
Copy link

@alexkb I use ui leaflet draw in a hybrid app developped using ionic, when I test in a local server on the computer's browser it works fine, but when I build the apk, install it on an andrid device, it doesn't work.

@nmccready
Copy link
Contributor

@AnasELMALEKI open a separate issue with an example for this. Closing due to @alexkb comment

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

No branches or pull requests

5 participants