Skip to content

feat: add collision behavior support for Advanced Markers - #143

Merged
pinpong merged 5 commits into
pinpong:devfrom
lorenc-tomasz:feat/advanced-markers
Sep 29, 2026
Merged

pinpong merged 5 commits into
pinpong:devfrom
lorenc-tomasz:feat/advanced-markers

Conversation

@lorenc-tomasz

@lorenc-tomasz lorenc-tomasz commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator

Pull request

Please ensure this PR targets the dev branch and follows the project conventions.
CI already runs linting, formatting, and build checks automatically.


Before submitting

  • This PR targets the dev branch (not main)
  • Commit messages follow the semantic-release format
  • No debug logs or sensitive data included

Summary

Adds Map ID plumbing and collision behavior support for Advanced Markers on Android and iOS while preserving the existing SVG-based marker API.

  • Adds optional initialProps.mapId configuration.
  • Adds optional RNMarker.advanced configuration.
  • Adds the extensible RNMarker.advancedOptions configuration object.
  • Adds advancedOptions.collisionBehavior.
  • Supports all three Google Maps collision behaviors.
  • Uses required as the default collision behavior.
  • Reports an INVALID_ARGUMENT map error when an Advanced Marker is requested without a map ID.
  • Reports an INVALID_ARGUMENT map error when advancedOptions is provided without advanced: true.
  • Falls back to a standard marker when the configured map does not expose the Advanced Markers capability.
  • Adds the onMapCapabilitiesChange callback for runtime capability updates.
  • Adds dedicated Map ID and Advanced Markers examples.

The existing iconSvg pipeline is reused. Native pin customization is not included.


Type of change

  • Feature
  • Fix
  • Refactor
  • Internal / CI
  • Documentation

Scope

  • Android
  • iOS
  • JS
  • Example App
  • Docs

Related

N/A


Additional notes

mapId remains optional for regular maps and standard markers.

A map ID is required when marker.advanced is true. When advanced is false or omitted, the existing standard marker implementation is used.

Collision behavior can be configured through:

{
  advanced: true,
  advancedOptions: {
    collisionBehavior: 'required-and-hides-optional',
  },
}

@lorenc-tomasz lorenc-tomasz changed the title Feat/advanced markers feat: add advanced markers support Aug 29, 2026
@lorenc-tomasz
lorenc-tomasz changed the base branch from main to dev August 29, 2026 18:33
@lorenc-tomasz
lorenc-tomasz force-pushed the feat/advanced-markers branch from c98ecde to b7163d3 Compare August 30, 2026 10:56
@lorenc-tomasz lorenc-tomasz changed the title feat: add advanced markers support feat: add map ID and advanced markers support Aug 30, 2026
@lorenc-tomasz
lorenc-tomasz force-pushed the feat/advanced-markers branch 2 times, most recently from 89fabf9 to 2c15bd2 Compare August 30, 2026 16:20
@lorenc-tomasz lorenc-tomasz changed the title feat: add map ID and advanced markers support feat: add Advanced Markers support Aug 30, 2026
@lorenc-tomasz lorenc-tomasz changed the title feat: add Advanced Markers support feat: add collision behavior support for Advanced Markers Aug 30, 2026
@lorenc-tomasz
lorenc-tomasz force-pushed the feat/advanced-markers branch from 2c15bd2 to 6da5551 Compare August 30, 2026 17:32
@lorenc-tomasz
lorenc-tomasz marked this pull request as ready for review August 31, 2026 06:22
@lorenc-tomasz

Copy link
Copy Markdown
Collaborator Author

Hi,
@pinpong What do you think about adding that to library? :)

@pinpong

pinpong commented Sep 29, 2026

Copy link
Copy Markdown
Owner

googlemaps/google-maps-ios-utils#574

https://issuetracker.google.com/issues/370536110

I'm still waiting for new maps utils version.

@pinpong
pinpong force-pushed the feat/advanced-markers branch 2 times, most recently from 8ee3d09 to dced078 Compare September 29, 2026 12:45
lorenc-tomasz and others added 5 commits September 29, 2026 20:23
A marker with advancedOptions is rendered as an Advanced Marker.
collisionBehavior decides how the marker, other markers and map labels
hide each other. pinConfig sets the background, border and glyph of the
default pin. iconSvg takes precedence over pinConfig, an svg that fails
to render leaves the icon empty.

onMapReady reports the map capabilities, onMapCapabilitiesChange
reports a later change. While Advanced Markers are not available, e.g.
without a map id or with the legacy renderer on Android, the marker is
rendered as a standard marker. It is re-created as an Advanced Marker
once they become available.

Co-authored-by: Lorenc Tomasz <lorenc.tomasz@gmail.com>
The advanced markers screen shows the pin variants and the collision
behaviors in a grid and the reported capability. The map id screen
opens a map with DEMO_MAP_ID.

The screens share one map center, the marker grids are placed around
it. The font entries of the xcode project are sorted by their id, as
pod install writes them.

Co-authored-by: Lorenc Tomasz <lorenc.tomasz@gmail.com>
@pinpong
pinpong force-pushed the feat/advanced-markers branch from dced078 to 8de1cb4 Compare September 29, 2026 13:25
@pinpong
pinpong merged commit 64d5386 into pinpong:dev Sep 29, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-dev.4 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants