【发布时间】:2016-01-11 11:59:35
【问题描述】:
我正在使用 GMaps.js 库,并且我使用的代码可以 100% 正常运行(在 localhost 上本地运行)——我创建的“webapp”也使用了 Google Maps Geocoding API。
我看不到我在代码中的任何位置添加 API 密钥的位置 - 尽管我有点困惑,因为它目前有效?当然,它应该只适用于有效的 API 密钥。
https://hpneo.github.io/gmaps/
<!DOCTYPE html>
<html>
<head>
<link href='example.css' rel='stylesheet' type='text/css' />
<link rel="stylesheet" type="text/css" href="style/style.css">
<script type="text/javascript" src="gmaps.js"></script>
<script type="text/javascript">
map = new GMaps({
div: '#map',
lat: 52.4801,
lng: -1.8835,
zoom: 7
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
【问题讨论】:
-
显然,形成源代码,它没有。
-
我有点困惑...... Google Maps Javascript API 和 Geocoding API 都提到了 API 密钥(除非我弄错了,这很有可能)以及我的应用程序的映射和地理编码方面似乎工作正常。这将在某个时候在实时环境中进行,因此预计会有大量请求......但看不到 API 密钥输入
-
是的,有一个 API 密钥之类的东西 - 不确定何时需要它(可能是大量请求) - 该库对它的支持为零
标签: javascript api google-maps api-key