This makes a smattering of changes to allow one to specify a container for mapbox GL compare. It was causing issues with transparency, because one map was actually layered on top of the other. So if it had transparent layers, the "before" map would peek through. This fixes this by clipping both maps instead of just one, which to me is a bit more in line with expectations.
This caused a really weird z-index issue because, believe it or not, the compare slider is actually appended to one of the maps containers, rather than being a sibling of the two maps. This asks users to specify a container, so the comparison slider isn't appended to a map, but can be put wherever the user chooses, typically in a wrapper that also holds both map canvasses.
Test that it works by creating a style with transparency, and then modifying /example to use your style IDs. That's what I did when making this thing anyways.
This makes a smattering of changes to allow one to specify a container for mapbox GL compare. It was causing issues with transparency, because one map was actually layered on top of the other. So if it had transparent layers, the "before" map would peek through. This fixes this by clipping both maps instead of just one, which to me is a bit more in line with expectations.
This caused a really weird z-index issue because, believe it or not, the compare slider is actually appended to one of the maps containers, rather than being a sibling of the two maps. This asks users to specify a container, so the comparison slider isn't appended to a map, but can be put wherever the user chooses, typically in a wrapper that also holds both map canvasses.
Test that it works by creating a style with transparency, and then modifying /example to use your style IDs. That's what I did when making this thing anyways.
@jseppi for review Closes https://github.com/mapbox/mapbox-gl-compare/issues/24