From 32940118e1ce63f4620f775c922176888a6e14db Mon Sep 17 00:00:00 2001 From: Drew Hill Date: Fri, 3 Nov 2017 17:53:55 -0400 Subject: [PATCH] (fix) auto-convert to number for marker input change from no warnings/errors/functionality to automatically converting latitude and longitude inputs to numbers if they are not of type number closes #771 --- packages/core/directives/marker.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/directives/marker.ts b/packages/core/directives/marker.ts index 7da46398f..f3de2c029 100644 --- a/packages/core/directives/marker.ts +++ b/packages/core/directives/marker.ts @@ -146,8 +146,12 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit { /** @internal */ ngOnChanges(changes: {[key: string]: SimpleChange}) { - if (typeof this.latitude !== 'number' || typeof this.longitude !== 'number') { - return; + if (typeof this.latitude !== 'number') { + this.latitude = Number(this.latitude); + } + + if (typeof this.longitude !== 'number') { + this.longitude = Number(this.longitude); } if (!this._markerAddedToManger) { this._markerManager.addMarker(this);