Skip to content

Commit

Permalink
fix(SebmGoogleMapCircle): removing circles
Browse files Browse the repository at this point in the history
Fixes #650
  • Loading branch information
sebholstein committed Sep 15, 2016
1 parent 1bc2ed8 commit 019f731
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/directives/google-map-circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export class SebmGoogleMapCircle implements OnInit, OnChanges, OnDestroy {
ngOnDestroy() {
this._eventSubscriptions.forEach(function(s: Subscription) { s.unsubscribe(); });
this._eventSubscriptions = null;
this._manager.removeCircle(this);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions src/core/services/managers/circle-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ export class CircleManager {
}));
};

/**
* Removes the given circle from the map.
*/
removeCircle(circle: SebmGoogleMapCircle): Promise<void> {
return this._circles.get(circle).then((c) => {
c.setMap(null);
this._circles.delete(circle);
});
}

setOptions(circle: SebmGoogleMapCircle, options: mapTypes.CircleOptions): Promise<void> {
return this._circles.get(circle).then((c) => c.setOptions(options));
};
Expand Down

0 comments on commit 019f731

Please sign in to comment.