Skip to content

[Web] InfoWindow snippet not displayed due to missing snippet handling in web.ts #87

@sekijum

Description

@sekijum

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:

const advancedMarker = new this.AdvancedMarkerElement({
position: marker.coordinate,
map: map,
content: content,
title: marker.title,
gmpDraggable: marker.draggable,
});

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions