Skip to content

Commit

Permalink
Fixed ts issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Apr 10, 2016
1 parent 60d58b8 commit 674dad0
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions components/gmap/gmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@ export class GMap implements AfterViewInit,DoCheck {
if(this.overlays) {
for(let overlay of this.overlays) {
overlay.setMap(this.map);

overlay.addListener('click', (event) => {
this.zone.run(() => {
this.onOverlayClick.emit({
originalEvent: event,
'overlay': overlay,
map: this.map
});
});
});

if(overlay.getDraggable()) {
this.bindDragEvents(overlay);
}
this.bindOverlayEvents(overlay);
}
}

Expand All @@ -64,6 +51,22 @@ export class GMap implements AfterViewInit,DoCheck {
});
}

bindOverlayEvents(overlay: any) {
overlay.addListener('click', (event) => {
this.zone.run(() => {
this.onOverlayClick.emit({
originalEvent: event,
'overlay': overlay,
map: this.map
});
});
});

if(overlay.getDraggable()) {
this.bindDragEvents(overlay);
}
}

ngDoCheck() {
let changes = this.differ.diff(this.overlays);

Expand Down

0 comments on commit 674dad0

Please sign in to comment.