function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Google Map Lighting help needed

Hey Guys,
I am trying to implement google map using lighting. I really don't have much idea about lighting.
My requirement is to show all nearby accounts on google map. 

Apex Class

public class accController { 
    public static List<Account> getAccounts() {
        return [select id, Account.BillingStreet, Account.BillingPostalCode, Account.BillingCity,sandbox__Geolocation__Longitude__s,sandbox__Geolocation__Latitude__s, Account.BillingState, Account.BillingCountry from Account where sandbox__Geolocation__Latitude__s != null];

<aura:component implements="force:appHostable" controller="accController">
    <ltng:require styles="/resource/leaflet/leaflet.css" />   
    <ltng:require scripts="/resource/leaflet/leaflet.js"
             afterScriptsLoaded="{!c.jsLoaded}" />
    <div class="map" id="map"></div>

jsLoaded: function(component, event, helper) {
    var accs = component.get("c.getAccounts");
        "sandbox__Geolocation__Longitude__s": component.get("v.sandbox__Geolocation__Longitude__s")
    setTimeout(function() {

/*Not Working-- this line */
        // var map ='map', {zoomControl: false}).setView([sandbox__Geolocation__Longitude__s,sandbox__Geolocation__Latitude__s], 14);
var map ='map', {zoomControl: false}).setView([25.509637,71.091645], 14);
                attribution: 'Tiles © Esri'
        // Add marker
            .bindPopup('Simplion Technologies Pvt Ltd');
The problem I am facing is to get dynamic longitude and latitude values from account object. As you can see I have commented out the line. 
If I hardcode the longitude (i.e. 25.509637) and latitude (i.e. 71.091645) values then it works fine for me. 
So I want to make this dynamic. So that it takes automatically longitude and latitude value from the account records.
If anyone can help me on this or give some ideas. It will be really helpful.
Best Answer chosen by Rajiv
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
There is whole tutorial in below link