Search code examples
google-maps-api-3google-maps-api-2

I got my Google API browser key. what should I do next?


I am working on an ASP.NET website that uses google maps API. as sited in the tutorial in google.com I need a google API key to make it work. I got that key, but every time that I run my website, I get the following error:

Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key

What could the problem be? The tutorial says nothing about what to do with the API key. It just says go to services and activate google Maps API v2 to get a key.

Thanks!


Solution

  • Did you include the API key into the URL when you load the Google Maps script?

    From the link to the docs in the error message:

    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false"
            type="text/javascript"></script>
    

    The link used to load the script is:

    http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false
    

    You need to replace that abcdef with the API key you got from Google Maps.