Using Geocoder as a stand-alone function

Re: [rcrofoot] Using Geocoder as a stand-alone function

By Jason - August 8, 2011

Hi Rick,

Yes, you can do this by calling the geocodeAddress() function directly. This function takes in an address (this can be a full address or a partial, ie zip code) and attempts to return the latitude and longitude of that address. The more information you have in your address, the more accurate your latitude and longitude is.

Here's an example of how you would call the function:

list ($latitude, $longitude) = geocodeAddress($address);

In this example, $address contains the address you want to geocode. at the end of the code, the lat and long of the address will be stored in $latitude and $longitude.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/