Skip to content

Angular-Maps not working in Angular 9 #127

Description

@Sakkie89

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

Activity

  1. krishtgkk commented on Mar 5, 2020

    @krishtgkk

    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)

  2. felesterio commented on Apr 30, 2020

    @felesterio

    Any updates on this yet?

  3. garysb commented on Apr 30, 2020

    @garysb

    Also awaiting a response on this

  4. krishtgkk commented on May 6, 2020

    @krishtgkk

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

  5. JoeMellon commented on Jun 9, 2020

    @JoeMellon

    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.)

  6. thor-schueler commented on Jun 10, 2020

    @thor-schueler
    Contributor
  7. JoeMellon commented on Jul 29, 2020

    @JoeMellon

    Any news on my PR been merged in yet?

    Many thanks!

  8. akki1153 commented on Feb 19, 2021

    @akki1153

    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.

  9. JoeMellon commented on Feb 22, 2021

    @JoeMellon

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions