使用谷歌API - GClientGeo codeR() [英] Using Google API - GClientGeocoder()

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

问题描述

我试图按照此页面:

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

但GClientGeo codeR()没有定义 - 有错误

我已经我们我的页面上的谷歌地图API:

 &LT;脚本类型=文/ JavaScript的 src=\"http://maps.googleapis.com/maps/api/js?key=<%=System.Web.Configuration.WebConfigurationManager.AppSettings[\"myGoogleKey\"]%>&sensor=false\"></script>

如何解决我的错误?

下面是我如何succesfuly使用API​​:

  VAR地图=新google.maps.Map(的document.getElementById(map_canvas的)
        myOptions);


解决方案

GClientGeo codeR()是一个版本2的对象。您正在加载API第3版,并需要使用第3版的对象和方法。

第3版相当于是 google.maps.Geo codeR()和描述的在文档。这是不一样的版本2的实现。

I try to follow this page:

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

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

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>

How to resolve my error?

Here is how I succesfuly use the API:

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

解决方案

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

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

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

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