Mark Locations On Google Map With Salesforce Lightning Component

Mark Locations On Google Map With Salesforce Lightning Component

Lightning Component

salesforce winter 19Salesforce winter 19 release has come with many awesome features. lightning:map base component is part of this release.  which will securely displays a map of one or more locations in salesforce lightning component . This component requires API version 44.0 and later.

Mark Locations On Google Map With Salesforce Lightning Component

Today in this post we are going to learn how we can display or mark locations on “lightning:map” (Google Map) base component dynamically, using sObject records data.

in this post i have created few records in account object with billing address to mark it on the lightning map.

Step 1 : Apex Controller [lightningMapController.apxc]

Step 2 : Lightning Component [lightningMap.cmp]

From developer console >> file >> new >> Lightning Component

map-markers is an array of markers that indicate location. A marker contains

  • Location Information: This can be a coordinate pair of latitude and longitude, or an address composed of address elements.
  • Descriptive Information: This is information like title, description and an icon which is information relevant to the marker but not specifically related to location.
  • for more details check here.
How To Fetch Multi Picklist Values From sObject To lightning:dualListbox Component

JavaScript Controller : [lightningMapController.js]

Lightning Application – From developer console >> file >> new >> Lightning Application

TestApp.app

Output :

Mark Locations On Google Map With Salesforce Lightning Component

Like our facebook page for new post updates.? & Don’t forget to bookmark this site for your future reference.

 Let us know if it helps you 🙂

people also check : How to Use Custom Font In Lightning Component Using Static Resource

 

(Visited 1,318 times, 24 visits today)

11 comments

Leave a Reply