mapbox / mapbox-gl-compare

Swipe and sync between two maps
ISC License
147 stars 42 forks source link

Slider position was wrong with mouse moving after the "margin-left" css of map was added #37

Open piedmontlong opened 4 years ago

piedmontlong commented 4 years ago

I tried to add the two maps with comparison inside a DIV. It worked in the beginning. But after adding the "margin-left" css to the DIV and expending the width of the maps, the slider position was wrong with mouse moving. There was an offset between the mouse position and the slider. The offset value is just the value of "margin-left". Do you have any thoughts to fix the issue? Thanks.