Angular-google-maps: Unable to show Angular 2 Google Map

Created on 17 Apr 2017  路  5Comments  路  Source: SebastianM/angular-google-maps

Issue description

I faced this issue when I am compiling my app using Visual Studio 2017 Angular 2 template + Angular 2 Google Map

An unhandled exception occurred while processing the request.

Exception: Call to Node module failed with error: Error: Uncaught (in promise): TypeError: this._elem.nativeElement.querySelector is not a function
TypeError: this._elem.nativeElement.querySelector is not a function

Steps to reproduce and a minimal demo of the problem

From the main.server.js, the codes in question are as follows:

SebmGoogleMap.prototype.ngOnInit = function () {
// todo: this should be solved with a new component and a viewChild decorator
var container = this._elem.nativeElement.querySelector('.sebm-google-map-container-inner');
this._initMapInstance(container);
};

I have included this map at the app.component.html




{{project.title}}



Description : {{project.description}}

Category : {{project.category}}

Project Type : {{project.projectType}}

Project Status : {{project.status}}






_What steps should we try in your demo to see the problem?_

Current behavior

Expected/desired behavior

angular2 & angular-google-maps version

@angular/cli: 1.0.0
node: 7.5.0
os: win32 x64
@angular/cli: 1.0.0
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/platform-server: 2.4.10
@angular/router: 3.4.10

angular2-google-maps 0.17.0
Other information

Most helpful comment

@jeremlb I'm working on a new documention right now

All 5 comments

Hello ! The directive had been renamed to agm-map.
https://github.com/SebastianM/angular-google-maps/blob/master/src/core/directives/map.ts

The documentation is clearly not up to date on https://angular-maps.com/

@jeremlb I'm working on a new documention right now

@SebastianM Thank you for your hard work :)

Seems like you are running your app on the server. That is not supported right now but there's already an issue for that.

I am having the same issue with either angular2-google-maps/core or agm/core (with the new directives).
I'm running VS2017. Is there are a work-around for this? I need to get my map going...

Thanks for all the awsome work you're doing on these frameworks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mensch picture mensch  路  3Comments

gizm0bill picture gizm0bill  路  4Comments

ostapch picture ostapch  路  4Comments

alexweber picture alexweber  路  4Comments

stot3 picture stot3  路  3Comments