In this recipe, you will be prompted to enter a location or landmark whose details you want to know. For example, if you enter Buckingham Palace, the recipe will display the city and postal code of the location where the palace is situated, along with its longitude and latitude values.
Finding out details of a location or a landmark
How to do it…
The search method of the GoogleMaps class is the key player in this recipe. The landmark or location entered by the user is passed to the search method. The city, postal_code, lat, and lng properties of the object returned from the search method are used to display the city, postal code, latitude, and longitude of the location, respectively. Let's see how it is done through the...