-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove radius1 for regular shapes, use radius instead #15191
Conversation
📦 Preview the website for this branch here: https://deploy-preview-15191--ol-site.netlify.app/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this simplification, thanks! And as we are changing property names anyway, could we use something like radiusInner
instead of radius2
?
changelog/upgrade-notes.md
Outdated
@@ -1,5 +1,10 @@ | |||
## Upgrade notes | |||
|
|||
### Next release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should explicitly mark that as a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the upgrade notes all about breaking changes? I don't see any previous changes marked explicitly as breaking there.
What do you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For version 8 the breaking changes were put in separate section: https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#backwards-incompatible-changes
This is what I had in mind
For RegularShape there is no requirement for {
"shape-points": 5,
"shape-radius1": ["+", ["*", ["sin", ["time"]], 10], 20],
"shape-radius2": ["+", ["*", ["sin", ["time"]], -10], 20],
"shape-rotation": ["*", ["time"], 0.2],
"shape-fill-color": "red",
"shape-stroke-color": "black",
"shape-stroke-width": 2
} |
I added a commit that allows radius2 to be larger than radius for webgl rendering. |
9958a0a
to
07fce62
Compare
Thanks, you're totally right! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the simplification and fixing the webgl style parser in the process! I'm not sure when would be the best time for merging this though, but still, at least this is approved.
07fce62
to
cad98c2
Compare
Having two optional parameters where one is required is bad for type-checking. Current handling is inconsistent. RegularShape constructor treated radius and radius1 as aliases while the webgl style parser used radius exclusively for polygons and radius1 exclusively for stars.
cad98c2
to
2965df1
Compare
Having two optional parameters where one is required is bad for type-checking.
Current handling is inconsistent. RegularShape constructor treated radius and radius1 as aliases while the webgl style parser used radius exclusively for polygons and radius1 exclusively for stars.