GoogleMapsAPIWrapper getBounds not returning
See original GitHub issueHello, I am trying to get the maps bounds thourgh the GoogleMapsAPIWrapper service. I am using the Promise<LatLngBounds> function getBounds().
Nothing is returned.
Here’s my code.
constructor(private searchService: SearchService,
private wrapper: GoogleMapsAPIWrapper,
private _loader: MapsAPILoader,
private zone: NgZone) {
}
ngOnInit() {
this.wrapper.getBounds().then(x => console.log(x));
}
the console.log function is not called as the peomise never returns anything.
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:21 (1 by maintainers)
Top Results From Across the Web
GoogleMapsAPIWrapper getBounds not returning #696
Hello, I am trying to get the maps bounds thourgh the GoogleMapsAPIWrapper service. I am using the Promise function getBounds(). Nothing is returned....
Read more >Google Maps Api v3 - getBounds is undefined
Map.getBounds() may return undefined initially. The preferred workaround to this is to use the bounds_changed event. Typically, an undefined ...
Read more >GoogleMapsAPIWrapper
Returns the native Google Maps Map instance. Be careful when using this instance directly. Returns : Promise<google.maps.Map>. getZoom.
Read more >map.getBounds() don't work
them, getBounds() may not be able to be called so soon after initializing the map. ... is returned (possibly because no map has...
Read more >agm/core
google-maps-api-wrapper ';\nimport * as mapTypes from '. ... n */\n getBounds(): Promise<LatLngBounds> { return this._manager.getBounds(this); }\n\n ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SebastianM Im using Angular4, I can confirm GoogleMapsAPIWrapper’s promises don’t work.
Using
sebm-google-map
component inside a template you can use:and then inside your component: