Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return best distance #2

Closed
Fil opened this issue Aug 22, 2016 · 3 comments
Closed

return best distance #2

Fil opened this issue Aug 22, 2016 · 3 comments

Comments

@Fil
Copy link

Fil commented Aug 22, 2016

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.

@curran
Copy link
Contributor

curran commented Jan 15, 2017

Another useful application of this would be variable size labels. That would be super cool.

@Thirdhuman
Copy link

Where would I make this edit in the polylabel code?

@curran
Copy link
Contributor

curran commented Jun 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants