Skip to content

feat(google-maps): Add the possibility to control visibility through an input #22488

@electrofLy

Description

@electrofLy

Feature Description

Currently you need to pass in the visibility of the marker in the options input. It is a lot more intuitive to have an input where you can change that.

<map-marker *ngFor="let marker of markers; trackBy: markerTrackerFn" [options]="{ visible: !marker.hide }"></map-marker>

instead of:

<map-marker *ngFor="let marker of markers; trackBy: markerTrackerFn" [visible]="!marker.hide"></map-marker>

Use Case

We are adding a large amount of markers to google maps and you can select to show only a portion of those markers. Instead of creating the markers again we want to change the visibility of the marker so you don't have to wait a long time. Using the Google Maps API this worked quite fast but it is really slow with using @angular/google-maps. We think that this is happening because of Angular change detection and/or that it redraws the markers everytime a new variable is passed in, in the options, in our case the visibility variable.

Nevertheless if this is the issue, it is still a lot more intuitive to control this via direct input than the options.

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