使用 Google API - GClientGeocoder() [英] Using Google API - GClientGeocoder()

查看:27
本文介绍了使用 Google API - GClientGeocoder()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试关注此页面:

http://melandri.net/2009/07/03/get-location-coordinates-using-google-maps/

但未定义 GClientGeocoder() - 存在错误.

but GClientGeocoder() is not defined - there is an error.

我已经在我的页面上使用了谷歌地图 API:

I already us the google maps api on my page:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=<%=System.Web.Configuration.WebConfigurationManager.AppSettings["myGoogleKey"]%>&sensor=false"></script>

如何解决我的错误?

以下是我成功使用 API 的方法:

Here is how I succesfuly use the API:

var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);

推荐答案

GClientGeocoder() 是版本 2 对象.您正在加载第 3 版 API,需要使用第 3 版对象和方法.

GClientGeocoder() is a Version 2 object. You are loading the Version 3 API and need to use Version 3 objects and methods.

版本 3 的等效项是 google.maps.Geocoder() 并且描述为 在文档中.它与版本 2 的实现不同.

The Version 3 equivalent is google.maps.Geocoder() and is described in the documentation. It's not the same as the Version 2 implementation.

这篇关于使用 Google API - GClientGeocoder()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆