diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index ac61fbff..482d91f3 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); } /**