Skip to content

Commit 2711bef

Browse files
committed
feat: add setAttribuets function for MarkerCollection
1 parent 41ff9d8 commit 2711bef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/marker-collection.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,18 @@ export class MarkerCollection<TUserData extends object = object> {
135135
}
136136
}
137137

138+
setAttributes(attributes: Partial<Attributes<TUserData>>) {
139+
this.markerAttributes_ = attributes;
140+
141+
for (const marker of this.markers_.values()) {
142+
marker.setAttributes(attributes);
143+
}
144+
}
145+
138146
protected generateKey(record: TUserData): string {
139147
if (!this.key_) {
140148
// if we don't have a key-function, we use a WeakMap to store
141149
// generated keys and issue a warning when updating.
142-
143150
let key = this.generatedKeyCache_.get(record);
144151
if (!key) {
145152
key = Math.random().toString(36).slice(2);

0 commit comments

Comments
 (0)