ionic-team / ionic-team/capacitor-google-maps
[Web] InfoWindow snippet not displayed due to missing snippet handling in web.ts
- Dominant language
- TypeScript
- Stars
- 32
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
When tapping on a marker in the web version using `@capacitor/google-maps`, the InfoWindow does not appear, even though `title` and `snippet` are set correctly in the code.
Upon investigation, we found that the `snippet` value is forcibly overwritten as an empty string in the web implementation:
https://github.com/ionic-team/capacitor-google-maps/blob/4fb47b5aae8fc820607a2cddfbea54284aec66c6/plugin/src/web.ts#L669-L675
As a result, InfoWindow does not open in the web version, while it works as expected in the native version.
### Expected behavior
InfoWindow should appear on marker click even if only `title` or `snippet` is provided, consistent with the behavior on native apps.
### To Reproduce
Steps to reproduce:
1. Set `title` and `snippet` when adding a marker.
2. Run the app in web environment.
3. Tap the marker.
4. InfoWindow does not appear.
### Environment
- `@capacitor/google-maps`: 7.0.2
- Platform: Web (browser)
- Framework: Vue 3 / Ionic + Capacitor
### Additional context
- The issue does not occur in native iOS/Android apps.
- This difference in behavior makes it difficult to maintain parity between web and native versions.
- We manually patched the library for testing, and InfoWindow worked correctly when `snippet` was preserved.
### Suggestion
Please avoid overwriting `marker.snippet` with an empty string in the web implementation.
Reference:
- https://github.com/capacitor-community/google-maps/issues/193
- https://stackoverflow.com/questions/78331772/how-to-open-an-infowindow-using-capacitor-google-map-plugin
Contributor guide
Assessment
This issue has not been assessed yet.