Jump to content
Fórum Script Brasil
  • 0

Agm-map dando erro em localhost e no servidor


Question

Estou usando o AgmCoreModule, para marcar endereços no google maps.

No module, no import

     imports: [
         AgmCoreModule.forRoot({
           apiKey: 'xxxxxxxxxxx'
        }),
     ]
no export
      exports: [
            AgmCoreModule
     ]

No ts

     texto = 'teste';
       lat = -19.91506;
       lng = -44.00752;
       zoom = 15;

No html

     <agm-map [latitude]="lat" [zoom]="zoom" [longitude]="lng">
       <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
     </agm-map>

A principio ele mostra
gk2AK.png
Mas depois dá este erro
AqZmp.png
Ou este erro

sTEt6.png

No servidor está dando este erro.
X6kMv.png

O Chave key está  liberada

 

    main.cb562ea7df40e3f09b5f.bundle.js:2 Refused to load the script 'https://maps.googleapis.com/maps/api/js?v=quarterly&callback=agmLazyMapsAPILoader&key=AIzaSyCD54jiJhEBda5MtJkgFJB-hfR6dv5V9jw&language=pt' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://storage.googleapis.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

     main.cb562ea7df40e3f09b5f.bundle.js:2 ERROR Error: Uncaught (in promise): Event: {"isTrusted":true}
         at x (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at x (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at main.cb562ea7df40e3f09b5f.bundle.js:2
         at e.invokeTask (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at Object.onInvokeTask (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at e.invokeTask (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at t.runTask (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at y (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at t.invokeTask [as invoke] (main.cb562ea7df40e3f09b5f.bundle.js:2)
         at u (main.cb562ea7df40e3f09b5f.bundle.js:2)

O  que pode ser ?

 

 

 

Edited by Netsoft
Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148887
    • Total Posts
      644948
×
×
  • Create New...