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

Add an Alternative to Google Maps in Lightning Environment

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

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.

Matt Goldspink

Lead Engineer, Vlocity Engineering

Matt is a Lead Engineer in Vlocity’s UI Engineering team, focused on developing beautiful user interfaces using Salesforce’s Lightning technology. Prior to Vlocity, Matt was a software trainer, teaching software development at multiple Fortune 500 companies. He also worked at Causata (now part of NiCE) and Morgan Stanley, where he led the development of their mobile platform.

Tags: vlocity salesforce Lightening