Closed Fil closed 4 years ago
Another useful application of this would be variable size labels. That would be super cool.
Where would I make this edit in the polylabel code?
This would be nice to have.
At the moment, I'm looking at the MultiPolygon label placement problem.
Approach for now: show labels only for the polygon with the largest area, within a given MultiPolygon.
FWIW I'd vote for Non-breaking change 1.
it would be super useful in many cases to know what the best distance was, for example to decide whether or not to display a label, or to use in other computations.
Non-breaking change 1:
var r = [bestCell.x, bestCell.y]; r.distance = bestCell.d; return r;
Not-too-much-breaking change 2:
return [bestCell.x, bestCell.y, bestCell.d];
1 is probably nicer but some developers might find the array/object mix awkward to work with.