KEMBAR78
feat: added BitmapDescriptor as parameter to AdvancedMarker by kikoso · Pull Request #718 · googlemaps/android-maps-compose · GitHub
Skip to content

Conversation

@kikoso
Copy link
Collaborator

@kikoso kikoso commented Jul 10, 2025

The following PR adds a new parameter BitmapDescriptor to the AdvancedMarker. The AdvancedMarker has, as an addition to the Marker, the possibility to set up an iconView, a pinConfig and/or the CollisionBehavior. It could be that users only want to control the CollisionBehavior, so this interface could be useful.

Fixes #708 🦕

@googlemaps-bot
Copy link
Contributor

Code Coverage

There is no coverage information present for the Files changed

@kikoso kikoso marked this pull request as ready for review July 10, 2025 17:36
@dkhawk dkhawk self-requested a review July 10, 2025 17:36
}
update(pinConfig) {
if (iconView == null) {
if (icon == null && iconView == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Do you need the icon to be set to proceed? I am not sure about this code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order of priority we set the iconView, then the pinConfig and then the icon. This is to cover the case where many parameters are set at once.

I have added a comment to clarify this.

// 3. If neither iconView nor pinConfig are available, fall back to the raw icon.

if (iconView != null) {
advancedMarkerOptions.iconView(iconView)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: these multibranch conditionals typically read better as a when statement

@dkhawk dkhawk merged commit e1c2277 into main Jul 14, 2025
12 of 13 checks passed
@dkhawk dkhawk deleted the feat/added_icon_bitmap_descriptor_to_marker branch July 14, 2025 20:13
googlemaps-bot pushed a commit that referenced this pull request Jul 14, 2025
# [6.7.0](v6.6.0...v6.7.0) (2025-07-14)

### Features

* added BitmapDescriptor as parameter to AdvancedMarker ([#718](#718)) ([e1c2277](e1c2277))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 6.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add icon (BitmapDescriptor) parameter for AdvancedMarker

3 participants