Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular-Maps not working in Angular 9 #127

Open
Sakkie89 opened this issue Feb 10, 2020 · 9 comments
Open

Angular-Maps not working in Angular 9 #127

Sakkie89 opened this issue Feb 10, 2020 · 9 comments

Comments

@Sakkie89
Copy link

As in the title, angular-maps doesn't work with Angular 9

The reason is how the viewchild is resolved. If you use ViewChild or ContentChild, angular is updating the way they resolve these queries to give developers more control. You must now specify that change detection should run before results are set. Example: @ViewChild('foo', {static: false}) foo !: ElementRef;.

https://angular.io/guide/static-query-migration

@krishtgkk
Copy link

We are trying to upgrade to Angular 9 and Bing Map is not even loading.
TypeError: Cannot read property 'nativeElement' of undefined
at MapComponent.ngOnInit (angular-maps.js:7523)

@felesterio
Copy link

Any updates on this yet?

@garysb
Copy link

garysb commented Apr 30, 2020

Also awaiting a response on this

@krishtgkk
Copy link

The team at least inform us if you are committed to working on this repo at all

@JoeMellon
Copy link

JoeMellon commented Jun 9, 2020

I've ended up forking this and fixing in my own repo. Just needed the InitMapInstance function moving to AfterViewInit lifecycle.

(More like a hot fix though, I've not changed the dependencies to Angular 9.)

@thor-schueler
Copy link
Contributor

thor-schueler commented Jun 10, 2020 via email

@JoeMellon
Copy link

Any news on my PR been merged in yet?

Many thanks!

@akki1153
Copy link

akki1153 commented Feb 19, 2021

What to do to run bingmaps in angular 9?

@JoeMellon How you have implemented InitMapInstance?

Pls give solution on this. I am also getting same error like krishtgkk.

@JoeMellon
Copy link

What to do to run bingmaps in angular 9?

@JoeMellon How you have implemented InitMapInstance?

Pls give solution on this. I am also getting same error like krishtgkk.

I forked this repo and added my fix to it and use that...needs the InitMapInstance function moving to AfterViewIniti lifecycle. See my PR in this repo for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants