1

I am working on magento-1.9 version. When I am going to contact us page, I got the following error which is Oops! Something went wrong.

Please help me on this. Please let me know the requirements what I have to share here to get the solution.enter image description here

Based on user SH Patel's suggestion, i ran the URL with my API key. Then i got following screen. Please find the attachment.enter image description here

2 Answers 2

1

Google map JS use API for display map.

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">

Check API key which you have used, Check API for host is match for your current host or not.

2
  • I mean check created API which you have used is specific for domain. Commented Dec 1, 2016 at 9:27
  • Can you give me site URL ? Commented Dec 1, 2016 at 9:31
1

Follow the steps to setup the google map.

Step 1: Generate API key.

  • Get an API key from here.
  • Go to the Google API Console.
  • Create or select a project.
  • Click Continue to enable the API and any related services.
  • On the Credentials page, get an API key (and set the API key restrictions). enter image description here

Step 2: Create configuration file to add the below Javascript file.

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">

Configuration file

To do this use the same script or link XML as normal but include src_type="url". As noted in the documentation

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" src_type="url"/>
</head>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.