info@getoncrm.com
+91-7405042484
GetOnCRM Solutions
  • Company
    • About
  • Services
    • Salesforce Sales Cloud
    • Salesforce Service Cloud
    • Salesforce Community Cloud
    • Salesforce Lightning
    • Salesforce Pardot
    • Salesforce CPQ
    • Contract Lifecycle Management
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
  • Case Study
  • Blog
  • Career
  • Contact Us
  • Let’s talk
GetOnCRM Solutions
  • Company
    • About
  • Services
    • Salesforce Sales Cloud
    • Salesforce Service Cloud
    • Salesforce Community Cloud
    • Salesforce Lightning
    • Salesforce Pardot
    • Salesforce CPQ
    • Contract Lifecycle Management
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
  • Case Study
  • Blog
  • Career
  • Contact Us
  • Let’s talk
GetOnCRM Solutions
  • Company
    • About
  • Services
    • Salesforce Sales Cloud
    • Salesforce Service Cloud
    • Salesforce Community Cloud
    • Salesforce Lightning
    • Salesforce Pardot
    • Salesforce CPQ
    • Contract Lifecycle Management
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
  • Case Study
  • Blog
  • Career
  • Contact Us
  • Let’s talk
  • Company
    • About
  • Services
    • Salesforce Sales Cloud
    • Salesforce Service Cloud
    • Salesforce Community Cloud
    • Salesforce Lightning
    • Salesforce Pardot
    • Salesforce CPQ
    • Contract Lifecycle Management
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
  • Case Study
  • Blog
  • Career
  • Contact Us
  • Let’s talk
Blog
Home Salesforce Lightning How Google Maps Work In Lightning Web Components?
Salesforce Lightning

How Google Maps Work In Lightning Web Components?

getoncrm November 24, 2020 0 Comments

In lightning web components, a ‘lightning: map’ component is used to display a map of many locations, using geocoding data and mapping imagery from Google maps. It can be used to set multiple location pins. Moreover, clicking on the location pins would display widgets with the description, account name, and a link to its record details.

Do Google Maps work in lightning web components?

The short answer is, no. This is because of locker service. Google Maps add multiple <script> tags when loaded. With locker service enabled, this is not possible due to security restrictions.  Currently, you can disable locker service but eventually it will be mandatory. So, is there any other way Google Maps can work in lightning web components?

Also Read: What is Salesforce Lightning Experience? Is Your Organization Ready for Salesforce Lightning Experience

YES, Google Maps work in Lightning web components. To get Google Maps to work in lightning web components we will need to implement maps in the visualforce page and embed in lightning web components as iFrame. One library that the locker service team opened in locker service is window.postMessage. This allows lightning web components to send/receive messages to/from visualforce pages. We could use this library and implement Google maps.

Scenario:

On the “Load Map” button click we will display a route between two points.

Implementation:

  • GoogleMapIframe.page
    • This will receive a message from the LWC page to load the map in iframe.

  • Mapcontainer.html ( LWC template )
    • It contains our visualforce iframe to load & button to send a message to visualForce for displaying markers.

Looking to Hire Salesforce Lightning Experts

Looking to Hire Salesforce Lightning Experts

  • mapcontainer.js ( LWC js file)

The final output:

This was tested in winter ’20 org and works fine even with Locker Service. On the outside, it all looks very complicated but once it has all been setup it looks very promising. window.postMessage library is very promising and offers opportunities for many use cases.

If you are thinking about building your app on the AppExchange, Contact us. At GetOnCRM Solutions, Our team of highly experienced Salesforce Lightning Experts can help you to customize and build beautiful apps and future for your platform on your unique business needs.

1
81 Views
Why You Should Invest in Salesforce Integration Services?PrevWhy You Should Invest in Salesforce Integration Services?October 30, 2020
Reasons Why Pharmaceutical Companies Choose Salesforce CRMNovember 27, 2020Reasons Why Pharmaceutical Companies Choose Salesforce CRMNext

Related Posts

Salesforce Lightning

Top Challenges of Transitioning to Salesforce Lightning and How to Overcome Them

In the present scenario, the demand for the Salesforce Lightning is...

getoncrm August 20, 2020
Salesforce Lightning

What is Salesforce Lightning Experience? Is Your Organization Ready for Salesforce Lightning Experience

The Salesforce platform has become an essential need for every business in...

getoncrm September 29, 2020

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts
  • Things to Consider While Developing A Salesforce Mobile App
  • How Salesforce Service Cloud Will Increase Business ROI with Digital Engagement?
  • How Salesforce CRM Help Insurance Organizations?
  • Salesforce Pardot – Steps To Success With Email Marketing Campaign
  • Top Salesforce Products That Can Transform Your Business
Categories
  • Apttus 1
  • Contract Lifecycle Management 1
  • CRM 2
  • Sales Cloud 1
  • Salesforce 21
  • Salesforce AppExchange 2
  • Salesforce Commerce Cloud 3
  • Salesforce Community Cloud 2
  • Salesforce CPQ 9
  • Salesforce CRM 5
  • Salesforce Einstein 3
  • Salesforce Integration 8
  • Salesforce Lightning 10
  • Salesforce Mobile App 6
  • Salesforce Pardot 5
  • Service Cloud 3

We are a global Salesforce consulting company that serves a broad mix of businesses, ranging from startups to big corporations. We help our clients make significant and lasting improvements to their performance and realize their most important goals, using Salesforce as a platform to enable digital processes.

  • About
  • Career
  • Services
  • Case Study
  • Blog
  • Contact Us
  • Let’s Talk
GetOnCRM Solutions
INDIA
Ahmedabad: B/706, Ganesh Plaza, Nr. Navrangpura Bus Stand, Navrangpura, Ahmedabad, Gujarat-380009,India.
info@getoncrm.com
minkesh.asc
info@getoncrm.com            
minkesh.asc
+91-7405042484
info@getoncrm.com            
minkesh.asc
Vadodara: 1008, 10th floor, OCEAN, Nr. Centre Square Mall, Sarabhai Compound, Dr. Vikram Sarabhai Marg, Vadodara, Gujarat, India.
USA
Address: 3080 Cowper Street Palo Alto, California 94306, USA
+1 (650) 704-5436
CANADA
Address: 1204 29 Ave NW Edmonton, AB T6T 0K8, Canada
+1 (250) 329-6480

Terms of use | Privacy Environmental Policy

Copyright © 2020 GetonCRM.  All Rights Reserved.

Copyright © 2020 GetOnCRM.  All Rights Reserved.

Copyright © 2019 GetOnCRM.
All Rights Reserved.

Book a Consultation

    We use cookies to deliver the best possible experience to you. By using our website, you agree to the use of cookies Find out more.