Maps API keys for geocoding not working
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.
- Visit the APIs console at https://code.google.com/apis/console and log in with your Google Account.
- 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
Ragini Shukla
Updated on June 04, 2022Comments
-
Ragini Shukla almost 2 years
I have read your answer on this. Maps API keys for geocoding not working anymore?
Currently I am trying this: https://maps.google.com/maps/api/geocode/json?address=n&sensor=true&key=apikeygoeshere
Giving me error:
This API project is not authorized to use this API.
Please suggest how can I complete my app. I am searching locations for my App.I can buy business plan later but for now I need to test for development. I have following services on: Google Maps Coordinate API, Google Maps Engine API, Google Maps Geolocation API, Google Maps JavaScript API v3, Google Maps SDK for iOS, Places API.