Ryan
Ryan

Reputation: 6866

Problem Loading Google Maps API

So I signed up for a Google Maps API key and the documentation I got after doing so says to load the Javascript Maps API, use the following code:

<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=[My API Key]"></script>

In using that code snippet I can't get the Google Maps Tutorial working so I changed the script tag above to match the one in the tutorial:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

And that one seems to work fine and doesn't have a reference to my API key... if that works fine is there any reason to get and use the API key?

Thanks!

Upvotes: 2

Views: 1448

Answers (1)

Pascal MARTIN
Pascal MARTIN

Reputation: 400922

As far as I remember, the V3 API doesn't require an API Key anymore (it was required with V2 of the API).

In your first code sample, you are using API v2.
But, in your second portion of code, you don't specify an API version -- in this case, I suppose it uses the default version, which currently is v3.

Upvotes: 3

Related Questions