Leaflet.PointInPolygon icon indicating copy to clipboard operation
Leaflet.PointInPolygon copied to clipboard

Centroid calculation

Open joric opened this issue 2 months ago • 0 comments

More a feature request than an issue. I wish it could calculate centroids also. Current leaflet only supports .getCenter() if the polygon is added to the map, so I have to add/delete polygons on loading stage.

It's also a bit wrong, i.e. the ideal place to put a label would be is to calculate x,y from center of mass and then adjust x so the label is equidistant from the edges. Now it's a bit off, see "lesser zone" here https://joric.github.io/stalker

joric avatar Dec 20 '24 12:12 joric