0

Since from 2 months I am trying to implement google maps.But still am not done with it.

Question 1,Question 2,Question 3 were my previous doubts.

After a long research I got to know that:-

"Google accepts only 10 requests/sec.If it receives more, then it generates a status 'OVER QUERY LIMIT'.Solutions are to buy that API(not sure about it completely) OR Generate a key with Google Maps which will accept 25000 req/day(Suitable for my requirement)".

Now I have a key.The issue is "It's usage".

Code snippet:

1.

<meta charset="UTF-8" />
    <script src="http://maps.google.com/maps/api/js?key=AIz************************************"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>

$(function () {
    //The list of points to be connected

<?php
***********

This gives an alert:

"The provided Google API key is invalid or this site is not authorized to use it"

2.

<meta charset="UTF-8" />
    <script src="http://maps.google.com/maps/api/js?sensor=true?key=AIz************************************"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>

$(function () {
    //The list of points to be connected

<?php
***********

Usage of sensor removes the alert but it still gives the status 'OVER QUERY LIMIT'.

As mentioned here I've tried editing the credentials and all but nothing works out.

Working fiddle

Kindly help me out in solving this. If possible give any direct steps, instead of so many links and indirect instruction/comments.

Thank you

Community
  • 1
  • 1
Prabs
  • 4,923
  • 6
  • 38
  • 59
  • When you use the sensor parameter, use an `&` after it, not a `?`. Have you enabled the key for the Google Maps Javascript API v3 and the URL you are using it on? – geocodezip Apr 24 '15 at 11:43
  • Ok..The format is like " – Prabs Apr 24 '15 at 11:51
  • I've used this ` – Prabs Apr 24 '15 at 12:10
  • @geocodezip I don't understand why your first comment will always be a last comment :( – Prabs Apr 25 '15 at 08:10

1 Answers1

0

I think I should stop using SO... This answer is for the beginners like me.

1.No need of sensor in Google API V3

2.Use browser key like this - <script src="http://maps.google.com/maps/api/js?key=AIz************************************"></script>

3.In Edit allowed references under credentials give the complete path. Explained in this Answer

Community
  • 1
  • 1
Prabs
  • 4,923
  • 6
  • 38
  • 59