justinmanley/Leaflet.Illustrate

Map layers offset to show off-screen texbox

Closed this issue · 0 comments

After pushing commit fcd6080, I encountered very weird behavior in MapKnitter that wasn't present in the demo in examples/simple.html .

When I loaded a map containing Leaflet.Illustrate.Textbox annotations, the toolbar and the map tiles had a strange right offset: issue 7 When I selected the textbox drawing tool, the new textbox was not created under my cursor, but appeared offset by the same amount. Strangely, dragging the map around and zooming out sometimes got rid of the offset. Toggling position: relative on the top-level map <div> also fixed the issue.

After messing around with a bunch of different changes, I finally identified a possible cause of the issue. It looks like the map was being offset to show off-screen textboxes on the map, if possible. Strangely, adding another annotation to the far left off-map removed this issue and caused the map to load normally.

This is most likely an issue with the new CSS styles introduced in the commit referenced above.