1

I use Angular Google Maps. And everything is working well except one thing.

Once I want to add styles to the map, using the styles input attribute, I get an error:

js?v=quarterly&callback=agmLazyMapsAPILoader&key=mykey:78 GET https://maps.googleapis.com/maps-api-v3/api/js/39/10/intl/ru_ALL/stats.js net::ERR_ABORTED 500
zone-evergreen.js:659 Unhandled Promise rejection: Could not load "stats". ; Zone: <root> ; Task: Promise.then ; Value: Error: Could not load "stats".
    at HTMLScriptElement.__zone_symbol__ON_PROPERTYerror (js?v=quarterly&callback=agmLazyMapsAPILoader&key=AIzaSyCyzqB8Udgs8s8kthQzK61Sq7Vghu8LiyE:80)
    at HTMLScriptElement.wrapFn (zone-evergreen.js:1218)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Zone.runTask (zone-evergreen.js:167)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:480)
    at invokeTask (zone-evergreen.js:1621)
    at HTMLScriptElement.globalZoneAwareCallback (zone-evergreen.js:1647) Error: Could not load "stats".
    at HTMLScriptElement.__zone_symbol__ON_PROPERTYerror (https://maps.googleapis.com/maps/api/js?v=quarterly&callback=agmLazyMapsAPILoader&key=AIzaSyCyzqB8Udgs8s8kthQzK61Sq7Vghu8LiyE:80:236)
    at HTMLScriptElement.wrapFn (http://localhost:8100/polyfills.js:1231:43)
    at ZoneDelegate.invokeTask (http://localhost:8100/polyfills.js:412:35)
    at Zone.runTask (http://localhost:8100/polyfills.js:180:51)
    at ZoneTask.invokeTask [as invoke] (http://localhost:8100/polyfills.js:493:38)
    at invokeTask (http://localhost:8100/polyfills.js:1634:18)
    at HTMLScriptElement.globalZoneAwareCallback (http://localhost:8100/polyfills.js:1660:21)

The styles are correct and the map is styled, but the error occurs, which should not...

Styles:

  testStyle = [
    {
      elementType: 'geometry',
      stylers: [
        {
          color: '#f5f5f5',
        },
      ],
    },
  ];

Usage:

  <agm-map
    [class.fullscreen]="(view$ | async) === 'map'"
    [disableDefaultUI]="true"
    [zoom]="12"
    [zoomControl]="false"
    [latitude]="56.946285"
    [longitude]="24.105078"
    [fitBounds]="true"
    [styles]="testStyle"
  >
    <agm-marker
      *ngFor="let object of objects$ | async"
      [latitude]="object.point[0]"
      [longitude]="object.point[1]"
      [agmFitBounds]="true"
    ></agm-marker>
  </agm-map>

If I provide blank styles, like: testStyle = []; - then there is also no error.

I found on internet that this could be caused by the AdBlock. But now I've disabled all browser extensions, but the error still remains.

Sergej
  • 2,030
  • 1
  • 18
  • 28

1 Answers1

2

Solved! The loading of the script was blocked by AdGuard utility program (not browser extension). It is a program for Macbook.

Sergej
  • 2,030
  • 1
  • 18
  • 28