JamesLMilner / terra-draw

A library for drawing on maps that supports Mapbox, MapLibre, Google Maps, OpenLayers and Leaflet out the box
https://terradraw.io
MIT License
448 stars 52 forks source link

Circular editing mode, displaying only the top, bottom, left, and right four points #208

Open Thunder7991 opened 6 months ago

Thunder7991 commented 6 months ago

1709717538939

In circular editing mode, there are too many points, can we only display points in four directions?

JamesLMilner commented 6 months ago

Thanks for raising this, I can understand why it would be useful. This is not specifically unique to selecting a polygon feature drawn with the Circle mode, and is true of all polygons that get selected. It would be hard to change the behaviour to for just selecting polygons, so what I think would be better would be to be able to set a configurable variable which would reduce the number of selection points rendered for a given polygon.

I would like to be able to support this, but it would be quite a bit of work and I probably won't be able to get to it in the immediate future.

Thunder7991 commented 6 months ago

Thanks for raising this, I can understand why it would be useful. This is not specifically unique to selecting a polygon feature drawn with the Circle mode, and is true of all polygons that get selected. It would be hard to change the behaviour to for just selecting polygons, so what I think would be better would be to be able to set a configurable variable which would reduce the number of selection points rendered for a given polygon.

I would like to be able to support this, but it would be quite a bit of work and I probably won't be able to get to it in the immediate future.

image

@JamesLMilner This is a very good idea, so that it can customize polygons, which is also an advantage compared to other plugins. I really hope the author can optimize it, and I think it will be more applied to projects.

Thunder7991 commented 6 months ago

Based on the analysis of the source code, the workload of such modifications is indeed enormous, Can we hide the layer with multiple points on the existing basis and add a layer with four points on top, bottom, left, and right, and fix it to the circular edge through some algorithm It has the same functions as multi-point positioning.