-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add setAttrWithMinSize
to feature API
#725
Conversation
https://github.com/onthegomap/planetiler/actions/runs/6877731457 ℹ️ Base Logs fdee80d
ℹ️ This Branch Logs da20687
|
Kudos, SonarCloud Quality Gate passed! |
Nice. Do you have an example use case? |
This openmaptiles PR does something similar for the |
Add a new
features.getMinZoomForPixelSize(zoom)
method to feature API that returns the minimum zoom level at which a feature is a certain size in pixels, and a conveniencefeature.setAttrWithMinSize(key, value, minPixelSize)
method that uses it to set the min zoom based on feature size.For more flexibility you can do math on the result of
features.getMinZoomForPixelSize(zoom)
or create aZoomFunction
that calculatesfeature.getPixelSizeAtZoom(zoom)
and applies a custom threshold based on the zoom level.