谷歌地图 JavaScript API 警告:NoApiKeys

4

1
Google在进行API调用时需要API密钥。你需要向Google支付费用才能使用他们的API。如果你只需要一个带有位置标记的互动地图,可以使用iframe。 - Nicolo Lüscher
2个回答

5

1
如果您不想购买API密钥,而只需要静态地图,则可以使用iFrame来实现。

<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=university%20of%20san%20francisco&t=&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://www.pureblack.de"></a></div><style>.mapouter{text-align:right;height:500px;width:600px;}.gmap_canvas {overflow:hidden;background:none!important;height:200px;width:300px;}</style></div>

但我不知道这样做还能持续多久。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接