-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 some missing math expressions #5853
Comments
Would be a |
I don't think we should allow expressions to be non-deterministic. That would produce unpredictable results across tiles and complicate static rendering and caching. If you want a "random" value, generate it when you generate your data and make it a feature property. |
Hm, yeah, I agree that the static rendering / caching issues are problematic, but would unpredictable rendering across tiles be problematic? An (admittedly weird) alternative would be to provide (a) a |
If Other problematic behaviors:
|
Make sense! Thanks for the explanation :) |
In addition to the operators mentioned above, the following expression operators would improve compatibility with NSExpression, which would benefit the iOS and macOS SDKs:
mapbox/mapbox-gl-native#10726 synthesizes |
A practical use case would be variance to 'fill-extrusion-height' in order to avoid z-fighting for colored roof faces. |
|
Refs #5853 * Add abs, round, floor, ceil operators * Round away from 0 * Add entries to v8.json * Test non-integer abs * Edits from review
Along these lines, a The Mapbox Streets source often reports identical
It isn’t necessarily appropriate for the Streets source to dither the values. This field might be used for other purposes. Moreover, the amount of dithering might need to vary based on the extrusion layer’s opacity or the camera’s zoom level or pitch.
For the building height dithering use case, It’s already problematic to split a building feature across tiles for other reasons. This is why the 3D Buildings tileset has buildings span tile boundaries instead of being split across them. The lack of a Perhaps this workaround points to a way we can implement a |
I think the random can be used effectively to create slight variation when it's applied in a minimal manner. For example some times you want minimal variation to your map to prevent it from appearing 'sterile' or too consistent; @1ec5 makes some great points above regarding 3d buildings where they all look exactly the same. Perhaps you want to introduce some slight variation in building height, or color, but not too much. |
The text was updated successfully, but these errors were encountered: