Leaflet.Elevation icon indicating copy to clipboard operation
Leaflet.Elevation copied to clipboard

Issues in Internet Explorer and Edge

Open corinat opened this issue 8 years ago • 5 comments

Hello,

It seems there is a problem with the plugin in Internet Explorer and Edge, the icon doesn't appear on the track when the mouse is over the profile. Has anyone figured the cause of this? I believe there is a compatibility problem with the d3.js library.

corinat avatar Sep 14 '16 14:09 corinat

I think some of the touch events changed in Edge, but I'm not sure and unfortunately currently have no time for investigation.

MrMufflon avatar Sep 29 '16 18:09 MrMufflon

My solution for this issue was this : "if (L.Browser.chrome.touch) { background.on("touchmove.drag", this._dragHandler.bind(this)). on("touchstart.drag", this._dragStartHandler.bind(this)). on("touchstart.focus", this._mousemoveHandler.bind(this)); L.DomEvent.on(this._container, 'touchend', this._dragEndHandler, this);

    } else {
        background.on("mousemove.focus", this._mousemoveHandler.bind(this)).
        on("mouseout.focus", this._mouseoutHandler.bind(this)).
        on("mousedown.drag", this._dragStartHandler.bind(this)).
        on("mousemove.drag", this._dragHandler.bind(this));
        L.DomEvent.on(this._container, 'mouseup', this._dragEndHandler, this);
    }

    if (L.Browser.chrome) {
        background.on("touchmove.drag", this._dragHandler.bind(this)).
        on("touchstart.drag", this._dragStartHandler.bind(this)).
        on("touchstart.focus", this._mousemoveHandler.bind(this));
        L.DomEvent.on(this._container, 'touchend', this._dragEndHandler, this);

    } else {
        background.on("mousemove.focus", this._mousemoveHandler.bind(this)).
        on("mouseout.focus", this._mouseoutHandler.bind(this)).
        on("mousedown.drag", this._dragStartHandler.bind(this)).
        on("mousemove.drag", this._dragHandler.bind(this));
        L.DomEvent.on(this._container, 'mouseup', this._dragEndHandler, this);
    }

     if (L.Browser.ie.touch) {              
         background.on("mousemove.focus", this._mousemoveHandler.bind(this)).
        on("mouseout.focus", this._mouseoutHandler.bind(this)).
        on("mousedown.drag", this._dragStartHandler.bind(this)).
        on("mousemove.drag", this._dragHandler.bind(this));
        L.DomEvent.on(this._container, 'mouseup', this._dragEndHandler, this);             
     } else if (L.Browser.ie) {              
         background.on("mousemove.focus", this._mousemoveHandler.bind(this)).
        on("mouseout.focus", this._mouseoutHandler.bind(this)).
        on("mousedown.drag", this._dragStartHandler.bind(this)).
        on("mousemove.drag", this._dragHandler.bind(this));
        L.DomEvent.on(this._container, 'mouseup', this._dragEndHandler, this);             
     }"

I don't know how elegant this is, but it works for all the browsers.

corinat avatar Sep 29 '16 18:09 corinat

I see the same issue, with latest versions of Edge and IE.

@corinat Can you fork this repo and show what you changed to make the altitude appear when mousing over the profile ?

fbonzon avatar Oct 04 '16 01:10 fbonzon

Hi @fbonzon . I created a pull request file where I put the code. I am not used working on github, so I hope I didn't mess things up. :)

corinat avatar Oct 06 '16 07:10 corinat

see also #67

nrenner avatar Mar 08 '17 16:03 nrenner