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

Broken in Microsoft Edge #13

Open
Lknechtli opened this issue Jul 17, 2017 · 9 comments
Open

Broken in Microsoft Edge #13

Lknechtli opened this issue Jul 17, 2017 · 9 comments

Comments

@Lknechtli
Copy link

In Microsoft edge, the section of the slider that you grab is not visible / grabbable.
image

@gmaclennan
Copy link
Member

Thanks for opening an issue for this. This was a known limitation when I first wrote this and still needs a fix, ideally by someone with Windows and Microsoft Edge :)

@Lknechtli
Copy link
Author

I ended up implementing my own version of the library because we needed a bit more flexibility.
I found that the easiest way to implement the slider portion was just to not use a range input since styling it is so painful across browsers.
Divs + mouse move events is not quite as responsive, but it's virtually impossible to tell unless you've got a LOT going on.

@chriszrc
Copy link

chriszrc commented Oct 12, 2017

Any chance you could share your fork, or create a pull request, I can't use this library if it doesn't support IE :'(

Also, given the state of slider-thumb support, I think @Lknechtli's approach might be a better way to go:
https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-slider-thumb
https://developer.mozilla.org/en-US/docs/Web/CSS/::-ms-thumb

@Lknechtli
Copy link
Author

Lknechtli commented Nov 2, 2017

@chriszrc
We haven't pulled it out into a library, and it's kind of a half-baked concept right now.
If you're interested in the ideas I was toying with, you can take a look at this:
https://github.com/raster-foundry/raster-foundry/tree/develop/app-frontend/src/app/components/map/labMap
Commit where I ripped out SbS and implemented the version we're using now: raster-foundry/raster-foundry@16ad769
Most relevant are the frame, frameview, and divider.
Basic idea was to be able to support arbitrary masking - features suck as rotating the divider using a handle, or a grid view, but other tasks have taken priority in the meantime.
If you have any questions, or are interested in improving and turning it into a library yourself, feel free to contact me using the email on my profile

@m-mohr
Copy link
Contributor

m-mohr commented May 11, 2018

I tried to fix this, but Edge doesn't seem to allow this natively without many JS side workarounds. Setting an absolute position on the range slider simply breaks the events on the thumb in Edge. It doesn't respond any longer. Positioning it with a container element helps with this, but that has two side-effects:

  1. The thumb image doesn't scale correctly.
  2. The range slider events are triggered on those parts on the map that are overlapped by the range slider. Therefore you can't completely interact with the map.

@gspettel
Copy link

I'm using the plugin on an internal project, and it works well for us (Edge, Chrome, Safari and FF) with the following css changes :

.leaflet-sbs-range {
position:relative;
background:none;
height:40px;
pointer-events:auto;
z-index:1500;
}

.leaflet-sbs {
position:absolute;
height:100%;
width:100%;
z-index:1500;
}

@m-mohr
Copy link
Contributor

m-mohr commented Jun 28, 2018

@gspettel That doesn't work for me in neither Edge nor Chrome. It doesn't even show the range button any longer in Chrome. Do you have a hosted working example somewhere? Or the working code on GitHub? I must have missed something or its just working in some cases...

@chriszrc
Copy link

chriszrc commented Jun 29, 2018

Looks like mapbox has a nice one now:

https://github.com/mapbox/mapbox-gl-compare

Officially supported too - https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-compare/

@Lknechtli
Copy link
Author

I've been experimenting with the mapbox slider on side projects for a bit.
My impressions:

That slider has performance issues, because it requires rendering two whole maps at the same time, and hiding parts of each of them. Performance issues when rotating the map while the view angle is not straight down are the most apparent - the two sides of the map will frequently get out of sync while rendering and it's very clear that one side of the map is following the other. The performance issues mostly happen on my computer when you've zoomed in to about the state level.

It also has some other odd issues - when zooming using a shift+click+drag, the box that is drawn will not carry across the two halves of the map. Any interactions on mouse click + drag need to be reported to both sides and duplicated on both maps in order for it to look seamless, and the plugin doesn't do a very good job at it. Basemap tiles are requested twice, even if they are the same on both maps, etc.
On the plus side, as far as I can tell it works on every browser that mapbox does.

I stuck up a simple app (wip) which can compare two TMS layer urls using the slider here, you can see for yourself. https://lknechtli.github.io/elm-map-compare/
I suspect that the performance issues for this app stem from a combination of using a TMS basemap (as opposed to a vector layer) and the full screen map application. For smaller maps I haven't noticed as much of an impact.

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

No branches or pull requests

5 participants