-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
icon-padding supports array #1289
Conversation
Bundle size report: Size Change: +459 B
ℹ️ View Details
|
This looks very good! |
tl;dr - sticking with existing I started by just using It was more complicated once I started looking into expressions and especially interpolation. Ideally, you'd want to be able to interpolate between I can see potential for a future addition of |
I see, thanks for the extra info! |
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.
See my comments.
Overall looks very good!!
I think more tests are needed in the files you added the padding definition, parsing, serialization etc...
Add new 'padding' type for style properties. Extend the behavior of icon-padding to support up to 4 values, including negative values, similar to how the CSS margin property works.
19b2efa
to
1ce5756
Compare
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 all the effort!
@drwestco Can you please resolve conflicts? I think this is ready to be merged right? We removed all the serialization code in another PR, right? |
Yes. The serialization code was removed in PR #1315 |
export type SymbolPadding = [number, number, number, number]; | ||
|
||
export function getIconPadding(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, feature: SymbolFeature, canonical: CanonicalTileID, pixelRatio = 1): SymbolPadding { | ||
// Support text-padding in addition to icon-padding? Unclear how to apply asymmetric text-padding to the radius for collision circles. |
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.
Not sure I know what to do with this comment - is this a TODO?
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.
Yes. Not sure there's a use case for extending text-padding like I did icon-padding. I can remove the comment and open an issue if that makes more sense.
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.
Yup, I think an issue would be better...
Last few nit picking I stumbled upon before this can be merged. Sorry for all the back-and-forth... |
…re-gl-js into stylePaddingType
Thanks a lot for bearing with all my annoying comments! :-) |
Add new 'padding' type for style properties. Extend the behavior of icon-padding to support up to 4 values, including negative values, similar to how the CSS margin property works.
Replacement for #1237 - extending behavior of existing
icon-padding
instead of introducing a new property.Launch Checklist
maplibre-gl-js
changelog:<changelog></changelog>
.