sales@getoncrm.com
+91-7405042484 (Sales Inquiry)
GetOnCRM Solutions
  • Company
    • About
  • Services
    • Salesforce Sales Cloud
    • Salesforce Service Cloud
    • Salesforce Community Cloud
    • Salesforce Lightning
    • Salesforce Pardot
    • Salesforce CPQ
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
    • Heroku Cloud Solutions
    • Salesforce Field Service Lightning
  • 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
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
    • Heroku Cloud Solutions
    • Salesforce Field Service Lightning
  • 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
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
    • Heroku Cloud Solutions
    • Salesforce Field Service Lightning
  • 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
    • Salesforce Appexchange
    • Salesforce Integration
    • Data Management
    • Salesforce Mobile Application
    • Salesforce Commerce Cloud
    • Apttus CPQ
    • Salesforce Einstein
    • Salesforce Marketing Cloud
    • Heroku Cloud Solutions
    • Salesforce Field Service Lightning
  • 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 Solutions 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.

24
676 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

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 Solutions September 29, 2020
Salesforce Lightning

Increase Your Lightning Apps with the Utility Bar

The utility bar provides your users quick access to common productivity...

GetOnCRM Solutions June 5, 2017

Leave a Reply Cancel reply

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

Recent Posts
  • Accelerate Transformation Of Sales With Salesforce Sales Cloud
  • The Top 5 Benefits Of Using Salesforce For Fintech Companies
  • The Implementation Of Salesforce Marketing Cloud – A Segmented Approach
  • What Is The Role And Responsibilities Of Salesforce CRM Consultant
  • What’s The Cost Of Salesforce CRM Consulting Services In The Healthcare Industry?
Categories
  • Apttus 1
  • Contract Lifecycle Management 1
  • CRM 4
  • Field Service Lightning 2
  • Financial 1
  • Healthcare 1
  • Heroku 1
  • Logistics 2
  • NEWS 2
  • Pharmaceutical 2
  • Sales Cloud 3
  • Salesforce 29
  • Salesforce AppExchange 4
  • Salesforce Commerce Cloud 5
  • Salesforce Community Cloud 4
  • Salesforce CPQ 14
  • Salesforce CRM 12
  • Salesforce Einstein 4
  • Salesforce Integration 14
  • Salesforce Lightning 13
  • Salesforce Marketing Cloud 9
  • Salesforce Mobile App 7
  • Salesforce Pardot 7
  • Service Cloud 4
  • Tableau CRM 1

We are a global Salesforce silver consulting partner 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.

   forcetalk-getoncrm-salesforce

  • 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.
sales@getoncrm.com
 career@getoncrm.com
sales@getoncrm.com         
career@getoncrm.com
+91-7405042484 (Sales Inquiry)
+91-7016864265 (HR/Career)
sales@getoncrm.com         
career@getoncrm.com
Vadodara: 1008, 10th floor, OCEAN, Nr. Centre Square Mall, Sarabhai Compound, Dr. Vikram Sarabhai Marg, Vadodara, Gujarat, India.
+91-7859895713 (HR/Career)
UK
Address: Brackley Square, Woodford Green, London, IG8.
+44 7877 959 614
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 © 2022 GetOnCRM.  All Rights Reserved. | Our Official United Kingdom Website

Copyright © 2021 GetOnCRM.
All Rights Reserved.
Our Official United Kingdom Website