This plugin is really useful, but I hit a very frustrating issue with it:
As it stands, when I use it to render a polygon column, only the last row will have its polygon inside the desired viewport. All the other rows end up with the map offset from the intended centre. This screen capture shows an example of this behaviour. I get the same behaviour in firefox and chrome.
This issue doesn't reproduce when the geometry is a Point.
I tried various ways to resolve this (changed the rendering order, moved the map.fitBounds() inside a layer.add event or a map.addlayer event handler, declared a new layer var each time through the loop, etc). None fo those were effective. The one thing I found did work was spoofing a window resize event that doesn't actually change the window size after all the maps are rendered. This has the effect of redrawing all the maps which then centers them all correctly, as shown in this screen capture:
This is a rather unsatisfying fix as it doesn't really address the underlying issue, but it does at least offer a workaround.
This plugin is really useful, but I hit a very frustrating issue with it:
As it stands, when I use it to render a polygon column, only the last row will have its polygon inside the desired viewport. All the other rows end up with the map offset from the intended centre. This screen capture shows an example of this behaviour. I get the same behaviour in firefox and chrome.
This issue doesn't reproduce when the geometry is a Point.
I tried various ways to resolve this (changed the rendering order, moved the
map.fitBounds()
inside alayer.add
event or amap.addlayer
event handler, declared a new layer var each time through the loop, etc). None fo those were effective. The one thing I found did work was spoofing a window resize event that doesn't actually change the window size after all the maps are rendered. This has the effect of redrawing all the maps which then centers them all correctly, as shown in this screen capture:This is a rather unsatisfying fix as it doesn't really address the underlying issue, but it does at least offer a workaround.