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: [
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
/applications/core/interface/imageproxy/imageproxy.php?img=https://i.stack.imgur.com/gk2AK.png&key=9f60ad46fc246b36e91037aca52cd07a585647610d33c5c9ec84e3d99a19d3e3" width="559" data-imageproxy-source="https://i.stack.imgur.com/gk2AK.png" />
Mas depois dá este erro
/applications/core/interface/imageproxy/imageproxy.php?img=https://i.stack.imgur.com/AqZmp.png&key=5080b84b77a384f71e8c711db5b9f2bc5aa8834a77be9bd4804d3b5a01dd906e" width="690" data-imageproxy-source="https://i.stack.imgur.com/AqZmp.png" />
Ou este erro
/applications/core/interface/imageproxy/imageproxy.php?img=https://i.stack.imgur.com/sTEt6.png&key=bfcc4f6f56ba6d43ba4523745fe65901d4addd22f9b402cf90a6ae5b144c8ac3" width="670" data-imageproxy-source="https://i.stack.imgur.com/sTEt6.png" />
No servidor está dando este erro.
/applications/core/interface/imageproxy/imageproxy.php?img=https://i.stack.imgur.com/X6kMv.png&key=faa8e9d61e14345c306c133571359789ce90a4504a6c397cc58b1f54cdf4b130" width="1000" data-imageproxy-source="https://i.stack.imgur.com/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 ?
Discussão (0)
Carregando comentários...