Google地图导致本地禁止403

时间:2014-08-22 19:42:28

标签: javascript wordpress google-maps

我在wordpress项目的前端和管理员中使用谷歌地图v3。 (现在在我当地)

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

我将javascript文件保存到本地(如果这可能是问题)。

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

今天所有人都运作良好,今天:

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

最初和缩放和点击之后的许多错误都是指向44行。

我无法达到"每日25000的限制"。

问题是什么?我应该使用api-key吗?

感谢您的审核。

2 个答案:

答案 0 :(得分:1)

Google地图在localhost上运行时存在一些问题,API文档中应该有/应该有注释

答案 1 :(得分:0)

当我使用实时版本时,它有效。所以我从我的本地删除了javascript。但我不知道它是否是一种可持续的解决方案。

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