Maps API keys for geocoding not working

17,717

Solution 1

When you put your location (Capital Area Soccer League) in google map search, google plots the location in the map if it finds a correct geocodes but if it does not finds proper geocodes for the searched location then it shows suggestions of corrects locations in the dropdown. When you choose any of the locations from the dropdown - it has the correct lat long (geocodes) so it plots that in the map correctly.

So you should not use geocodes in the search rather open up a suggestions dropdown and when click on any of the suggested location then you have correct geocodes to plot in the map.

Solution 2

What you are referring to is not the Geolocation API. It is the Geocoding API. You need to enable the Geocoding API in your console. Please see the documentation.

  1. Visit the APIs console at https://code.google.com/apis/console and log in with your Google Account.
  2. Click the Services link from the left-hand menu in the APIs Console, then activate the Geocoding API service.

Hope this helps.

Solution 3

Try this URL, You Don't have to enter API Key in URL Just pass lat,lng in URL through a variable

http://maps.google.com/maps/api/geocode/json?latlng=-34.78,138.519&sensor=false

Share:
17,717
Ragini Shukla
Author by

Ragini Shukla

Updated on June 04, 2022

Comments