简体   繁体   English

Google Maps导致本地禁止403

[英]Google Maps causes 403 forbidden in local

I use google maps v3 in both front end and admin of my wordpress project. 我在我的wordpress项目的前端和管理员中都使用google maps v3。 (which is in my local now) (现在在我本地)

1. Front end shows the maps in the simplest way.
2. Admin lets the user click the map and define office location. 

I saved the javascript file to local (if this might be the problem). 我将javascript文件保存到本地(如果可能是问题所在)。

wp_enqueue_script( 'gmaps', get_template_directory_uri() . '/assets/js/gmaps/gmaps.js', array(), '1.0.0' );

All were working well yesterday, today: 昨天,今天所有人都工作良好:

1. Admin all gone, it sayes "403 forbidden" for all maps.
2. Front end shows maps but outputs many errors...

GET https://maps.googleapis.com/maps/api/js/StaticMapService.GetMapImage?1m2&1i…    
003640&2e1&3u19&4m2&1u400&2u250&5m5&1e0&5sen-GB&6sus&10b1&12b1&token=69746 403 (Forbidden) main.js:44

many errors like this initially and after zooming and clicking, all pointing line 44. 最初以及缩放和单击后,所有此类错误均指向第44行。

It is impossible for me to reach the "daily 25000 limit". 我不可能达到“每日25000个限制”。

What would the problem be? 这是什么问题? Should I use api-key? 我应该使用api键吗?

Thanks for reviewing. 感谢您的审查。

在本地主机上运行时,Google Maps存在一些问题,API文档中有/应该有一条注释

When I used the live version, it worked. 当我使用实时版本时,它可以工作。 So I removed the javascript from my local. 所以我从本地删除了javascript。 But I don't know if it's a sustainable solution. 但是我不知道这是否是可持续的解决方案。

https://maps.googleapis.com/maps/api/js?v=3.exp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM