Search code examples
angulargoogle-mapsangular-google-maps

AGM Angular Google Maps imagery not loading


It seems that reaching out to googleapis.com with AGM fails unless I have the googleapis.com script tag in the head of my index.html

AGM initialization in my module

AgmCoreModule.forRoot({
apiKey: 'MyKey',
libraries: ['imagery', 'places']
}),

Script tag in head

<script async defer src="https://maps.googleapis.com/maps/api/js? 
key=MyKey=imagery,places">
</script>

If I don't include the script tag I get the error...

GET https://maps.googleapis.com/maps-api-v3/api/js/35/10a/imagery.js 
net::ERR_ABORTED 404
Ae @ js? 
v=3&callback=agmLazyMapsAPILoader&key=MyKey&libraries=imagery,places:81
(anonymous) 
zone.js:682 Unhandled Promise rejection: Could not load "imagery". ; Zone: 
<root> ; Task: Promise.then ; Value: Error: Could not load "imagery".

I need to be able to use AGM independently of doing this.

Any help is greatly appreciated!!

UPDATE

I'm not loading "libraries" correctly in my AgmCoreModule...but I can't find how to do it correctly

UPDATE

All you have to do to get imagery tiles to load is set the

[mapTypeId]="satellite" 

Now my problem is that the imagery tiles do not load unless I zoom in or out on the map


Solution

  • This has been resolved through the comments above...more information here AGM Google maps imagery tiles not loading