Norkart / Leaflet-MiniMap

A minimap control plugin for Leaflet
BSD 2-Clause "Simplified" License
395 stars 125 forks source link

shadowRect clipped at the exit from the miniMap bounding rectangle #103

Open Nikcharn opened 8 years ago

Nikcharn commented 8 years ago

In your demo example, I found bug related to the circumcision of a shadowRect. Or is it so conceived?

robpvn commented 8 years ago

Nice reproduction! Well, I suppose we can call it a known bug. It's not on purpose, but after Leaflet changed something in how features are drawn in the map it started happening. It happens when you drag the map so that the shadow rectangle ends up moving outside of the original bounding box of the minimap, so I guess Leaflet has an optimisation to save memory/CPU by not drawing layers outside of a map's bounding box.

We could probably fix it by looking at Leaflet's code and maybe subclassing the drawing layers, but nobody has done the work yet.

derekreilly1990 commented 6 years ago

We use Your plugin, and have received an issue to fix this problem in our maps. Has there been any work done to correct this?

robpvn commented 6 years ago

As I'm sure you can guess from the very late response (sorry about that), there hasn't been any work done in the plugin, no. PRs are of course welcome!

rvillalba-novetta commented 5 years ago

An old thread, but I'm currently considering circumventing this issue, by copying the aiming rectangle element, appending it as a sibling, and setting the style of the new element to the shadow style. Any drawbacks to this and would a PR for this be considered?

eugene-raiser commented 5 years ago

You need to update renderer of _shadowRect in _inMiniMapMoving after setBounds