Entering API Key for Distance Widget

  • Profile Image
    Jonnyk
    Asked on August 02, 2019 at 04:16 PM

    Hi There, 

    I'm in need of some assistance when it comes to entering in my API key into the driving distance widget. 

    I have created an account on the google cloud platform and generated a distance matrix API. When I copy and paste the API into my widget, I am getting an error message. 

    I want to create a form for my website, where a user can view the distance between two points, then based on three rates per km (which they can choose), it will then generate a price. 

     

     

    1564776758Screen Shot 2019-08-02 at 4.09
    https://form.jotform.com/92136137440148

     

     

    Thanks, 

     

    I am still getting this error and I dont know how to fix it in my1564939558Screen Shot 2019-08-04 at 1.24

     

    If you could help me, it would be amazing! 

  • Profile Image
    Kevin_G
    Answered on August 02, 2019 at 05:32 PM

    I have cloned your form and it works on my end, you can test it out here: https://form.jotform.com/92136982917973

    Checking further your form I can see some errors in the console, a reference from Google is the following link: https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error 

    There are more details about why your API code does not work, kindly check the link and make sure you Google account is allowed to use Maps API key. 

    Thanks. 

  • Profile Image
    Jonnyk
    Answered on August 04, 2019 at 01:26 PM

    Thanks, 

     

    I am still getting this error and I dont know how to fix it in my1564939558Screen Shot 2019-08-04 at 1.24

     

    If you could help me, it would be amazing! 

  • Profile Image
    John_Benson
    Answered on August 04, 2019 at 02:48 PM

    I was able to replicate the issue when I opened your form. I received the same console error in my browser. Based on the error, it seems that your API is not activated. Please make sure that it is enabled, here's a guide: Enable and disable APIs.

    If the issue persists, then please make sure that these API Libraries are enabled:

    Distance Matrix API
    Maps Embed API
    Maps JavaScript API
    Places API for Web
    Geocoding API

    1564944423api-lib.png

    From your API Dashboard, please click the Library option in the left.

    1564944515lib.png

    Hope that helps. Let us know if you need further assistance.