Skip to content

Add input to control map marker icon #22097

@mattstarkey

Description

@mattstarkey

I am struggling to find a way to update the MapMarker icon using @angular/google-maps.

Here is a Stackblits example of what I am trying to do:
Link to stackblits

So every 3 seconds I would like to change the marker to either green or blue, this is just simulating a real world scenario.

The documentation states that MapMarker component wraps the google.maps.Marker class, so I should be able to use the .setIcon() method, but I am unsure of how to access the google.maps.Marker class in this case.

In this issue: #21068

The response comments notes that in this case I should not have to create the google.Maps.Marker object which makes sense, but when I change the MapMarker object inside my markers array I also get no change.

Does anyone have any experience with this that could share a solution or point me in the right direction?

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: google-mapsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions