Geolocation Question

This is actually a noob question. I have a location search field. Instead of user typing his location, I want use getCurrentGeolocation function to get user location and display it inside the search field or inside a Iframe. Can someone provide me with the exact syntax to achieve this? Basically I want the lat and long data to be displayed as street address. I tried the google mapsAPI but somehow there I am getting API not activated error. even when the API is activated and referrers defined.

The Example: Using the Places API from Google Maps services , shows how this is done.