Skip to content
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

The response of editing massive point pages is too slow #1299

Open
raopengfei opened this issue Jan 28, 2023 · 2 comments
Open

The response of editing massive point pages is too slow #1299

raopengfei opened this issue Jan 28, 2023 · 2 comments

Comments

@raopengfei
Copy link

I encountered the problem of a large number of dead points in page editing when using the latest leaf-geoman version. I tried to solve the problem in the demo and found that the enableGlobalEditMode method parameter passed
options: {limitMarkersToCount: 20, allowSelfIntersection: false, allowSelfIntersectionEdit: false},
However, the editing of the page is still very difficult. After the performance analysis of Chrome, the hasSelfIntersection method in the L.PM.Edit.Line file is too long. After the analysis of the code, this is the logic to judge the self intersection. It should be called after the allowSelfIntersection parameter and allowSelfIntersectionEdit parameter. The writing method referring to the _onMarkerDragStart method is better than the _onMarkerDragEnd method, In addition, the hasSelfIntersection method is also called in its method, such as the handleLayerStyle method Please refer to the screenshot for the specific execution time. I think you should review the method call check and judgment.
My English is poor. I hope you can understand my description. Thank you.
ME1674907951337
ME1674907956858

@Falke-Design
Copy link
Collaborator

Falke-Design commented Jan 28, 2023

If I understand you correctly, you suggest to move the hasSelfIntersection() call into _onMarkerDragStart. We can't do this, because we need to check after moving a vertex, we need to check if there is now a intersection.

But I think we should calculate self intersection only if allowSelfIntersection is false. I will create a fix in the next days.

@raopengfei
Copy link
Author

Thank you for your reply. Your last remark is correct. Before calling the hasSelfIntersection method, you need to check that the parameter allowSelfIntersection is true, but this is not the case in the _onMarkerDragEnd method and the handleLayerStyle method. Under multi-point conditions, it can reduce a lot of performance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants