English 中文(简体)
Google 地图 API 键不工作
原标题:Google Map API Key not working

我遵循谷歌的方向:

登录到 API 控制台, 激活 JSV3 (和 2) 地图 API, 前往访问部分, 请求新密钥, 使用他们打招呼的世界代码, 使用我的密钥, 而不是样本中的密钥, 它可以工作, 持续整整三秒钟。 然后我得到一个警告, 发出以下信息 :

Google 已禁用此应用程序使用地图 API 。 所提供的密钥不是一个有效的 Google API 密钥, 或该站点的 Google Maps Javascript API v2 不允许使用此密钥 。

下面是代码,我做错什么了?

<script src="//maps.google.com/maps?file=api&amp;v=2&amp;key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        type="text/javascript"></script>

<script type="text/javascript">
function initialize() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);
    GEvent.addListener(map, "click", function() {
      alert("You clicked the map.");
     });
  }
}  
</script>
问题回答

上面的Sean的建议-我打的是pi的V2, 不是v3, v2 正在/已经退化,所以很可能是问题所在。





相关问题
How to decide the current point reach on google map?

How to decide the current point reach on google map? I have a list of points (pickup points) of a route that I want to show in my google map with polyline. Now i have to get the current location of ...

Topographical or relief data in Map APIs

I was wondering if anyone knew of any map APIs that offer topographical or relief data? I ve had a quick look at Google and Bing APIs, but could find nothing there. Google allow you to view a map as ...

Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Adding a custom icon to a google map

I need a hand adding a custom icon to some Google Maps javascript. Code below for your reference: function populateMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new ...

RSS to KML Overlay

I m want to display my blog as a Google Map overlay (each post contains geotags). How can I dynamically create a KML overlay from an RSS? Or better, how can I create a loop (PHP) that would display ...

开放街道地图管理员

我需要开放Street的标记管理员。 地图,如山角地图。