0

How to add google map contact us page form.phtml file in magento 2.2

please advance thanks for help.

0

app/design/frontend/vendor/your-theme/requirejs-config.js

 var config={
  paths: {
    "jquery.googleapi": "https://maps.googleapis.com/maps/api/js?key=My-Key"
  },
  shim: {
    'jquery.googleapi': {
      'deps': [
        'jquery'
      ]
    }
  },
  deps: [
    "js/google_init"
  ]
};

My-Key : add Your key of google map

app/design/frontend/vendor/your-theme/Magento_Contact/layout/contact_index_index.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
   <body>
      <referenceContainer name="content">
         <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
            <container name="form.additional.info" label="Form Additional Info" />
         </block>
      </referenceContainer>
   </body>
</page>
|improve this answer|||||
0

See Contact Map extension on GitHub

|improve this answer|||||
0

Amasty Google Map Extension in Magento 2.2

Provide your customers with the clear details about the location of your business. Display the physical address on the 'Contact Us' page using the appealing Magento Google Map.

https://amasty.com/google-map-for-magento-2.html#screenshots

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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