After successfully getting the Swiping tool to function, our team proceeded on troubleshooting a bug that occurred alongside when panning at lower zoom levels. Essentially the issue was related to the limitations of clipping the layer in front, in addition to how we were calculating the clip in relation to the swipe’s handle.

The bug can be seen below after zooming in:

bug1 bug2Part of our solution was to add back the difference between the handle and the edge of the page.

Another bug that we had to iron out was dealing with users who may move the map around too fast, that makes position calculations difficult in javascript.

The resulting version can be seen below:

 

To fix this, we had to create a function that would account for the off-set whenever the user stopped panning the map.