Skip to content

bug(google-maps/advanced-marker-elements): setting mapId doesn't work #28608

Closed
@apixandru

Description

@apixandru

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using advanced marker elements, a mapid is required on the google-map element.
The google map element does have the mapId property but setting it doesn't appear to propagate it to the map.
I can get around this by using [options]="mapIdOptions" instead where mapIdOptions is google.maps.MapOptions = { mapId: "myId" }

Reproduction

Advanced marker elements require your own private mapId, I cannot create a StackBlitz to expose my key/map ids but the demo already app illustrates the issue.

StackBlitz link: use the dev-app google map demo, it doesn't work currently
Steps to reproduce:

  1. set the mapId inside the current dev-app
  2. run the application and notice it not load, the console says The map is initialized without a valid Map ID, which will prevent use of Advanced Markers.

Expected Behavior

I'm expecting the map to load without issues

Actual Behavior

The map fails to load with the message The map is initialized without a valid Map ID, which will prevent use of Advanced Markers. l

Environment

  • Angular: current main facd027
  • CDK/Material:
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: google-maps

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions