Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google API - GClientGeocoder()

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);
like image 870
user1322207 Avatar asked Apr 18 '12 15:04

user1322207


1 Answers

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.

like image 136
Andrew Leach Avatar answered Oct 31 '22 16:10

Andrew Leach