Skip to content

Commit

Permalink
feat(AgmMarker): auto-convert string to Number for lat/lng (#1424)
Browse files Browse the repository at this point in the history
fixes #771
  • Loading branch information
Dario Braun authored and sebholstein committed Jul 4, 2018
1 parent 2e4878b commit c1d6c6d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/directives/marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit {

/** @internal */
ngOnChanges(changes: {[key: string]: SimpleChange}) {
if (typeof this.latitude === 'string') {
this.latitude = Number(this.latitude);
}
if (typeof this.longitude === 'string') {
this.longitude = Number(this.longitude);
}
if (typeof this.latitude !== 'number' || typeof this.longitude !== 'number') {
return;
}
Expand Down

0 comments on commit c1d6c6d

Please sign in to comment.