openlayers-editor icon indicating copy to clipboard operation
openlayers-editor copied to clipboard

Complex geometries can generate a large number of cad guides

Open megawac opened this issue 2 years ago • 1 comments

Problem

As guides are generated by the edges of features registered for snapping, when map features have any complexity they can result in a large number of guides being generated. As shown in the image below, 2 features can generate a large number of lines (in the image 10). In our application we have seen in real maps 50+ lines being generated using nbClosestFeatures: 5. In cases like this the guides are essentially meaningless.

image

Proposal

Add a new option (limitGuidesFromFeature) to the cad control which provides the user the ability to limit the number of features that can be generated from any given feature. For example, you might limit the number of lines that can be possibly generated from a feature to 3; we would then limit the number of lines added to the map to the 3 most proximal to the users cursor. This way, there will be a hard maximum of lines ever shown on the users screen to nbClosestFeatures times the limitGuidesFromFeature.

(This is the strategy I plan to implement in my companies fork of the project, we will be happy to submit the implementation if this sounds reasonable).

megawac avatar Aug 23 '23 20:08 megawac

@megawac it sounds reasonable. Feel free to propose a PR.

oterral avatar May 10 '24 13:05 oterral