Reference error when using fitBounds with LatLngBoundsLiteral
See original GitHub issueIssue description Map component is not waiting for lazy loaded google API to be ready when using LatLngBoundsLiteral in fitBounds input
Steps to reproduce and a minimal demo of the problem
- Create a simple map with a LatLngBoundsLiteral in the
fitBounds
input
https://stackblitz.com/edit/angular-google-maps-demo-yuwcde?file=app%2Fapp.component.html
Current behavior Since the google maps API has not loaded yet during the OnChanges hook you can see an exception within the above example: Reference error “google” is not defined
Expected/desired behavior The map component should inject the api loader and use the load() method to obtain the Promise which resolves when the API is ready. By waiting for that promise to resolve and deferring the call to the API to fit the bounds, the issue should be fixed.
angular2 & angular-google-maps version Angular 6.1.7 / agm 1.0.0-beta.5
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6
Top GitHub Comments
A new release of the library should be published on NPM to have fix of this bug. How to do ? This project seems to die slowly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.