Entering API Key for Distance Widget

  • Jonnyk
    Asked on August 2, 2019 at 4: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 Screenshot 10
    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 Screenshot 21

     

    If you could help me, it would be amazing! 

  • Kevin Support Team Lead
    Replied on August 2, 2019 at 5: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. 

  • Jonnyk
    Replied on August 4, 2019 at 1: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 Screenshot 10

     

    If you could help me, it would be amazing! 

  • John_Benson
    Replied on August 4, 2019 at 2: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 Screenshot 10

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

    1564944515lib Screenshot 21

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