0
votes

lightning-map is useful however I found multiple limitations and I would like to implement my own version, someone knows where I can find an example of how to implement the library of google maps in LWC.

Implementing google maps is simple however in LWC third-party libraries must be loaded as a static resource for security when doing this I begin to have security errors.

I think salesforce uses a proxy to work https://maps.a.forceusercontent.com/lightningmaps/mapsloader?resource=primitiveMap&version=222, unfortunately the code of this component is not available to study if someone has the code of how to implement google maps and LWC would appreciate your guidance

2

2 Answers

0
votes

I didn't find a way to include resources in LWC, analyze the structure of the lightning-map component and use the same approach that this component has. I created an Iframe and a visual force that communicate with each other

0
votes

If you're looking to use the maps/places api. You'll have to create an apex class to fire the http requests. The google maps api doesn't allow cross domain javascript, and LWC won't allow you to import javascript that's not hosted in your salesforce org.