Skip to content
Browse files

Merge branch 'master' of github.com:cderue/GoogleMaps

  • Loading branch information...
2 parents 926150c + e203e8e commit a6057a8a7f9fd6fc1d13ff9ad27ed6a7c773f1eb Cedric Derue committed
Showing with 32 additions and 1 deletion.
  1. +32 −1 README.md
View
33 README.md
@@ -1,4 +1,35 @@
GoogleMaps
==========
-A Zend Framework 2 module that provides a PHP wrapper to the Google Maps Geocoding API
+A Zend Framework 2 module that provides a PHP wrapper to the Google Maps Geocoding API
+
+Geocoding example
+-----------------
+
+This example show how to use ZF2 GoogleMaps module to find locations by address (geocoding).
+
+ use GoogleMaps;
+
+ $address = '1600 Amphitheatre Parkway, Mountain View, CA';
+ $request = new Request();
+ $request->setAddress($address);
+ $proxy = new Geocoder();
+ $response = $proxy->geocode($request);
+
+ var_dump($response);
+
+Reverse geocoding example
+-------------------------
+
+This example show how to use ZF2 GoogleMaps module to find locations by latitude and longitude (reverse geocoding).
+
+ use GoogleMaps;
+
+ $lat = 40.714224;
+ $lng = -73.961452;
+ $request = new Request();
+ $request->setLatLng($lat . ',' . $lng);
+ $proxy = new Geocoder();
+ $response = $proxy->geocode($request);
+
+ var_dump($response);

0 comments on commit a6057a8

Please sign in to comment.
Something went wrong with that request. Please try again.