-
Notifications
You must be signed in to change notification settings - Fork 129
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add StyleSpans support for Polylines #546
Conversation
@@ -106,4 +213,4 @@ public fun Polyline( | |||
set(zIndex) { this.polyline.zIndex = it } |
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 notice that all these set()
calls should instead be update()
, for reasons of performance & tidiness. It would be helpful to reflect this concern somewhere, but I'm not a maintainer. Could you create a separate issue for this? Or fold it into this one, but it would seem to mix different concerns.
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.
@GoogleMapComposable | ||
private fun PolylineImpl( | ||
points: List<LatLng>, | ||
spans: List<StyleSpan> = emptyList(), |
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.
Looks like PolylineImpl()
could be eliminated entirely in favor of having a single Polyline()
method with a default parameter. It's a bit of a breaking change, but personally I'd favor it over having so much repetitive overload verbosity, just like with the Marker()
overloads nightmare. I'm not a maintainer, though.
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.
Then there will be confusion with the color
parameter - it makes no sense to specify it when we specify Spans for segments
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.
Agreed on keeping both separate, since we have spans
on a constructor and color
on another.
maps-compose/src/main/java/com/google/maps/android/compose/Polyline.kt
Outdated
Show resolved
Hide resolved
updated the documentation on the comments |
Thanks @el-qq ! This looks good. |
guys thank you so much for adding this, i need it in my project. can't wait to get it released |
@dkhawk merge? |
@el-qq , the Instrumentation Tests fail since the runner in your machine does not have access to the Maps API Key, this is expected from this PR. We are currently evaluating this feature. |
# [4.4.0](v4.3.5...v4.4.0) (2024-04-23) ### Features * Add StyleSpans support for Polylines ([#546](#546)) ([105112a](105112a))
馃帀 This PR is included in version 4.4.0 馃帀 The release is available on:
Your semantic-release bot 馃摝馃殌 |
Fixes #307 馃
There's a similar PR that was proposed some time ago. Unfortunately, the author has not responded or continued working on it.
Therefore, created a similar PR that takes into account the latest changes from the comments.
Before submitting your PR, there are a few things you can do to make sure it goes smoothly: