Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit ea471aa

Browse files
authored
fix(FitBounds): unsubscribe after unsuccessful computation
fixi an edge case problem where if user was using automatic fitBounds calculation suddenly switches to fitBounds object (e.g. LngLatBoundsLiteral) and then provided fitBounds by user would be overwritten by the active subscription. fixes: #1810
1 parent 4e38075 commit ea471aa

File tree

1 file changed

+3
-0
lines changed
  • packages/core/directives

1 file changed

+3
-0
lines changed

packages/core/directives/map.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
536536
}
537537
break;
538538
default:
539+
if (this._fitBoundsSubscription) {
540+
this._fitBoundsSubscription.unsubscribe();
541+
}
539542
this._updateBounds(this.fitBounds, this.fitBoundsPadding);
540543
}
541544
}

0 commit comments

Comments
 (0)