Geolocation widget not working properly

  • Philip_Seaton
    Asked on September 22, 2019 at 6:10 AM

    Hi. Trying to add a location selector to our form so that the guys can select where they are travelling to and from.

     

    But we just get a java error. Please can you help?

     

    1569146982Snip20190922 6 Screenshot 10

  • roneet
    Replied on September 22, 2019 at 7:35 AM

    There are some console logs which states that the Google API key is not properly enabled.

    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.

    Geolocation widget not working properly Image 1 Screenshot 20

    Let us know how it goes.

    Thanks.

  • Philip_Seaton
    Replied on September 25, 2019 at 6:46 AM

    Hi. I clicked on the link youu shared, but couldn't find the page on your screenshot. The API is already created, how do I get to this page to tick those boxes? Please provide a simple step by step for an idiot.

  • Girish JotForm Support
    Replied on September 25, 2019 at 8:37 AM

    You will get these options when you enable the Google Maps platform from the link below:

    https://cloud.google.com/maps-platform/ 

    Click on "Get started", which will give you the screen below.

    15694149732509 15 Screenshot 10

  • Philip_Seaton
    Replied on September 26, 2019 at 9:58 AM

    Hi. Thanks, I did this. Clicked all 3 boxes, added billing details etc, added the widgets and the API key and it still gives me the same error.

     

    Please help as we need to roll this out ASAP.

     

    Many thanks

  • roneet
    Replied on September 26, 2019 at 10:48 AM

    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

    Geolocation widget not working properly 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

    Geolocation widget not working properly Image 64

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

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

    5. Save the settings.

    Hope this helps!

    Thanks.

  • roneet
    Replied on September 26, 2019 at 10:50 AM

    Also, please check this link on the generation of Google API Click this link to see the video.

  • Philip_Seaton
    Replied on September 27, 2019 at 12:38 PM

    It just keeps telling me I don't have permission to enable the APIs


    1569602329Snip20190927 2 Screenshot 10

  • roneet
    Replied on September 27, 2019 at 1:23 PM

    Please make sure that you are signed in as the same person (the button next to the minimize button on chrome browser) as the account that you were using to log in to the developer's console to gain access.

    Please try logging out all other accounts and login to only one account. If that doesn't help try to login with some other account and try again.

    Also, you may try out these in incognito mode of the browser:

    https://support.google.com/chrome/answer/95464?co=GENIE.Platform%3DAndroid&hl=en

    Hope this helps.

  • Philip_Seaton
    Replied on September 30, 2019 at 3:46 AM

    OK, so 2 things I don't get the page you are showing in this screenshot when I click on the link you gave.


    1569829449Snip20190930 3 Screenshot 10

    Instead I get this....

    1569829508Snip20190930 4 Screenshot 21

    It seems that all of the APIs are enabled but I can't see "Key Restrictions" or "API Restrictions" anywhere.

  • Nik_C
    Replied on September 30, 2019 at 4:21 AM

    Try generating a new API key:

    https://developers.google.com/places/web-service/get-api-key

    Just follow that guide and you will be able to generate a new API key.

    Let us know if that works for you.

    Thank you.

  • Philip_Seaton
    Replied on September 30, 2019 at 4:50 AM

    Great! Finally we are there! 


    I created a new API key and it seems to be working well


    Many thanks for all your support