How do I create Google Maps API for the Geolocation widget?

  • TBSE
    Asked on July 18, 2019 at 8:43 PM

    Hello,

    I added the GeoComplete widget on the JotForm titled - Resort Registration / QR Code, etc......

    In the Resort Address box, I want users to fill-in an address (Worldwide) and have Google Maps automatically populate.

    Do you all provide the API Key, as what is noted in the panel?

    If I have to get my own, I attempted to follow the instructions on Google, but when I tested on JotForm, gave me the message like "DO you own this website?

    Can you tell me what I did wrong and help me fix this issue?

    THanks,


    George

  • roneet
    Replied on July 18, 2019 at 11:00 PM

    I tested your Form and noticed this error on the browser console.

    How do I create Google Maps API for the Geolocation widget? Image 20

    When you go to your Google Dev's page to create an API Key, make sure the 3 options are selected. These are essential in order for the widgets to work properly.

    How do I create Google Maps API for the Geolocation widget? Image 1 Screenshot 31

    Thus create a new Google API key and activate it.

    Let us know if this worked for you.

    Thanks.

  • TBSE
    Replied on July 18, 2019 at 11:16 PM

    OK,

    Will do. Do I have to pay Google for an API Key?

  • TBSE
    Replied on July 19, 2019 at 12:16 AM

    Hello,

    None of those options were on the google dashboard when I set up the API.

  • Nik_C
    Replied on July 19, 2019 at 2:01 AM

    You don't have to pay, but you have to connect your credit card, you will be asked for it. But you will not be charged.

    When you go to link: https://developers.google.com/maps/documentation/javascript/get-api-key

    You go to:

    1563515997Screen Shot 2019 07 19 at 7 Screenshot 10

    On the upper right corner.

    Then you choose Maps:

    1563516025Screen Shot 2019 07 19 at 8 Screenshot 21

    After that, you will be prompted to log in (if you're not) and you should be guided through.

    Let us know if you have any further questions.

    Thank you!

  • TBSE
    Replied on July 24, 2019 at 6:08 PM

    Hello,

    Can you check. I followed through, then saved my Jotform. Still getting the same error message.

    Can you check and see if you receive an error message as well.

    NOTE: I did set up that payment account and all. Do I have to RESTRICT anything on the maps platform I have, and if so to what restriction?

    Thanks,


    George

  • jonathan
    Replied on July 24, 2019 at 7:37 PM

    George, 

    I checked/tested Geocomplete/geolocation widget on my form and it is working properly at this time.

    1564010414zzz 2019 07 25 07 Screenshot 10


    I checked on your form and I also see the problem.

    1564010651zzz 2019 07 25 07 Screenshot 21

    If you click the link “Do you own this website?” it takes you to a page that lists the various reasons why the maps is being blocked:

    A general solution that works for most users is to edit your Google Maps API key settings and remove any restrictions:

    1. Look up an existing key to edit it:

    https://console.developers.google.com/project/_/apiui/credential

    2. Select your existing API key and click on your key name

    3. Under “Key Restrictions” make sure it’s set to “None”

    4. Click on the “API Restrictions” tab and make sure none of the maps features are selected from the drop down menu.

    5. Save the settings.

    Alternatively, you can just create a new key.  Be aware that you are now required to enter a valid payment method.

    Click here and follow the instructions provided to create a new API key:

    https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key

    ---


    NOTE: I did set up that payment account and all. Do I have to RESTRICT anything on the maps platform I have, and if so to what restriction?

    If you meant the payment field, the settings are not related to the geolocation widget setting.

    It is possible that your google map API issue had to do with your google account API settings.


    I hope this help. Let us know if issue remains.


  • TBSE
    Replied on July 24, 2019 at 7:43 PM

    Hello,

    Will check but I don't think I have any restrictions.

    When you tried, it allowed you to enter an address, no error message?

    Did you attempt to enter by street number first then street name (I saw you had Boston in the example)?

    Let me read and review what you forwarded and connect again shortly.

    Thanks,

    George

  • TBSE
    Replied on July 24, 2019 at 7:46 PM

    Also, when I click on "Do you own the website..." it does not take me to another browser, page, just disappears.

    I am using Google CHromebook as well.

    WIll return shortly.


    George

  • TBSE
    Replied on July 24, 2019 at 7:49 PM

    Both restrictions were set to none.......

    Can you check my JotForm settings as well, make sure I have those correct for the widget..

  • jonathan
    Replied on July 24, 2019 at 8:13 PM

    There is nothing much in the geolocation widget settings. I see that it was configured correctly.

    For testing purposes, I used my google map API instead on your form https://www.jotform.com/83525228403150

    And it is working properly on your form...

    1564013512zzz 2019 07 25 08 Screenshot 10


    with this, we can confirm that the issue is with your google map API key.  It could be the wrong google API key.

    Can you please try creating a new API key. Follow the steps on how to in the link guide below.

    https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key



  • TBSE
    Replied on July 24, 2019 at 8:18 PM

    Created a new key on my Google console, entered on JotForm, and same issue.

    How did you create your key?

    Is there something else on my Google setup I need to do?

  • roneet
    Replied on July 24, 2019 at 9:52 PM

    Please try the following: 

    1) Go to: https://developers.google.com/maps/documentation/javascript/get-api-key

    2) Click Get Started:

    15493588022019 02 05 10 24 29 Screenshot 20

    3) Choose all the 3

    How do I create Google Maps API for the Geolocation widget? Image 1 Screenshot 31

    4) Create a new project, so don't use the existing one:

    15493588732019 02 05 10 26 22 Screenshot 42

    And use that new key in your form.

    5. Enable billing at the end. You can also check your billing using this link: https://console.cloud.google.com/project/_/billing/enable

    If you have already activated the billing, then that must the Places API. See below:

    https://console.cloud.google.com/apis/library/places-backend.googleapis.com?q=places

    15627965442019 07 11 015 Screenshot 53

    If it is not enabled, you will see the Enable button instead of Manage.

    6. Also, enable all the location-specific APIs here:

    https://console.cloud.google.com/google/maps-apis/overview

    How do I create Google Maps API for the Geolocation widget? Image 64

    Hope this helps!

    Thanks.

  • TBSE
    Replied on July 24, 2019 at 10:29 PM

    Ok,

    Will complete and follow-up within the next 10 minutes.

  • TBSE
    Replied on July 24, 2019 at 10:42 PM

    Finally,

    It is working. Can you double-check as well.

    I believe the only thing I did differently was to check the box 2 and 3 (Routes and Places).

    Last, the API key I currently have for this particular JotForm, can I use the same for others or do I need to create a new one for each JotForm?

    THanks,


    George

  • roneet
    Replied on July 24, 2019 at 11:53 PM

    Yes, it is working now. We are glad that the steps provided in the above posts helped you set up the key.

    How do I create Google Maps API for the Geolocation widget? Image 10

    Yes, you can use this API which you have generated for all your Forms.

    Let us know if you have further questions.

    Thanks.

  • TBSE
    Replied on July 24, 2019 at 11:55 PM

    OK great,

    Thanks again and you guys are awesome.

    Cheers,

    George