Add an Alternative to Google Maps in Lightning Environment | Vlocity - Industry Cloud Apps

Vlocity’s Matt Goldspink Describes How to Add an Alternative to Google Maps in the Lightning Environment

Welcome back to Matt Goldspink’s blog series “Learning How to Write Professional, Robust and Beautiful Lightning Components for Salesforce.”

Sep 14, 2017 by Matt Goldspink
Lead Engineer
3 minute read
Add an Alternative to Google Maps in Lightning Environment

Matt, a lead engineer in Vlocity’s UI Engineering team, creates elegant user interfaces with Salesforce’s Lightning Experience, and the key focus of his blog is about targeting JavaScript developers and individuals looking to explore the Lightning Component Framework and optimizing their Salesforce performance with pre-built components.

The latest installment of Matt’s blog series “How NOT to add Google Maps to a Lightning Component!” explains how to add a map component to Lightning other than Google Maps. Right away, you might be asking yourself, why not just use Google Maps? Essentially, to embed Google Maps developers would need to rely on the use of an iframe. The is because the Google Maps JS API has to be used from their servers. Lightning currently does not allow users access to a JavaScript library like that. So while there’s a workaround, it becomes complicated very quickly. 

What Matt proposes is to leverage a super simple library called Leaflet.js. Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps and uses just 37kb of JS and has all the mapping features and performance most developers require.

From there, what follows is a technically savvy but expedited step-by-step tutorial from Matt on how to integrate Leaflet into your Lightning environment. It’s still on the non-simple side of things, but Matt does all the hard work for you, teaching ways to diagnose issues in advance and simplify the process (as much as is possible). If followed correctly, developers will find a surefire, cogent way to embed mobile-friendly, interactive maps into their Lightning Experience.

Learn more about Salesforce Lightning as well as the agile, cloud-based omnichannel and industry-specific solutions from Vlocity at this year’s Dreamforce event. Don’t miss this exciting opportunity to network with the best and the brightest, catch amazing sessions and demos, and schedule a meeting with our team of experts to discover more about the Industry Cloud and how Vlocity apps are transforming the customer experience.