From dff034a5b682b200d9ba3b02d20e9aa1b6d2f215 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Tue, 6 Sep 2016 23:23:06 -0400 Subject: [PATCH] feat(googlemaps): can pass HTMLElement to constructor --- src/plugins/googlemaps.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index ac61fbff3..482d91f34 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -107,8 +107,9 @@ export class GoogleMap { return; } - constructor(elementId: string, options?: any) { - this._objectInstance = plugin.google.maps.Map.getMap(document.getElementById(elementId), options); + constructor(element: string|HTMLElement, options?: any) { + if (typeof element === 'string') element = document.getElementById(element); + this._objectInstance = plugin.google.maps.Map.getMap(element, options); } /**