Leaflet.PointInPolygon
Leaflet.PointInPolygon copied to clipboard
Centroid calculation
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