-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a renderBuffer option to ol.layer.Vector #3061
Conversation
LGTM, thanks ! |
This looks great to me. Very nice description of the problem and the solution. I still think we could check for contains since we are always comparing buffered extents - I agree we would have a problem if we only checked to see whether the rendered extent contained the unbuffered frame extent. But as I mention above, given the other conditions, there are few cases where the batch extent contains but does not equal the buffered frame extent. Interested if I'm missing something, but please merge in any case. |
I changed the commit history. Here the exchange @tschaub and I had on some previous commit:
https://github.com/elemoine/ol3/commit/567316c8d9fc3fd9c1d2dff933a7b92c95e10106 |
Only recreate batch when the (buffered) rendered extent contains the **buffered** viewport extent.
Add a renderBuffer option to ol.layer.Vector
This PR fixes a the bug reported in #2851 and a
renderBuffer
option tool.layer.Vector
.The bug reported in #2851 can be easily reproduced using the icon example. Just move the map north until the icon hits the bottom of the viewport: the icon disappears as soon as the icon position (
[0, 0]
) is outside the viewport.This PR fixes the bug by removing the
ol.extent.intersects
tests in theReplayGroup
'sreplay
functions. This meansReplay
objects are now unconditionally replayed, even when their envelope does not intersect the viewport extent.Also, currently, we do not recreate a new
ReplayGroup
when the extent of the currentReplayGroup
contains the viewport extent. This means that we may have rendering issues (symbols/icons not drawn) when the viewport approaches the boundary of ttheReplayGroup
extent.This PR addresses this problem by using not re-creating the batch only in the case where the
ReplayGroup
extent equals the viewport extent. But note that we still do not create newReplayGroup
's during animations and interactions.And, at last, this PR adds a
renderBuffer
option tool.layer.Vector
that allows specifying the size (in pixels) of the rendering buffer around the viewport extent. The default value is 100 pixels, but larger values can be used when using large icon sizes or line widths. This option is somewhat similar to MapServer'stile_map_edge_buffer
.Please review.
Fixes #2851.