-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
[FEATURE] Add toggle for viewport filtering in vector layers #1997
Comments
Hi @tchahnson, |
Thank you for the clarification @JaffaKetchup ! |
I have attempted to test the culling, and I have found that it seems to make no effective improvements in performance.
And for the following comparison of my version (code not included in comment) [left] vs the out the box culling enabled (as per code seen above) [right], I have found that the performance and speed is considerably improved with my method. I understand that the 'polygons & total edges displayed' may not reflect the actual rendered shapes and that the shapes may be cached instead for performance. As I am unable to optimize the performance, may I ask for assistance with diagnostics to better configure flutter_map for performance? |
Hello @tchahnson, can you elaborate a bit how |
The In the example provided, as the resolution of vector data is dynamically adjusted based on the zoom level, only the higher resolution polygons are used. |
Is is possible that you mix up culling and simplification? flutter_map has a simplification algorithm as well that can be configured with the simplificationTolerance parameter but your feature request is about polygon culling, right? |
Yes, the polygons generated in my examples are identical between the two scenarios, and my request is specific to the rendering of polygons dependent on their inclusion in the view window. |
What do you want implemented?
I propose adding a boolean toggle (
drawToViewport
) toPolygonLayerOptions
(and possibly other vector layers likePolylineLayerOptions
). This would allow developers to enable or disable viewport-based filtering of vector shapes (e.g., polygons, polylines).This feature would:
Details:
Currently, vector layers such as polygons are filtered based on the viewport to improve performance when displaying large datasets. While this is useful, there are scenarios where developers may want to display all vector shapes regardless of their visibility within the viewport. For example:
By introducing a
drawToViewport
boolean, developers can explicitly control whether to filter vector data by the viewport.What other alternatives are available?
Currently, the only workaround is to modify the logic in _updateDisplayedPolygons (or similar methods) to disable filtering. However, this approach:
Introducing this feature at the library level ensures a standardized, reusable, and maintainable solution.
Can you provide any other information?
Here’s an example of how the
drawToViewport
option could be implemented:_updateDisplayedPolygons
:This change would be backward-compatible, as
drawToViewport
would default to true.Severity
Annoying: Currently have to use workarounds
The text was updated successfully, but these errors were encountered: