Jump to content
Fórum Script Brasil
  • 0

Agm-map dando erro em localhost e no servidor



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

No module, no import

     imports: [
           apiKey: 'xxxxxxxxxxx'
no export
      exports: [

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>

A principio ele mostra
Mas depois dá este erro
Ou este erro


No servidor está dando este erro.

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 comment
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.

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
    • Total Posts
  • Create New...