Skip to main content 3월 5~6일에 샌프란시스코에서 열리는 TDX 또는 Salesforce+에서 Agentforce와 함께 미래를 구축하세요. 지금 등록하기.
I have a json as follows

 var providerObj = [];

        providerObj = [{"providerName":"Dr.George A.Beller","network":"In Network","street":"94 Connecticut Blvd","city":"East Hartford","country":"US","state":"CT","postalCode":"06108",

                        "distance":"1.3","phone":"860-528-1359"},

In my component I am using a lightning:map to display the address, this piece of code is working fine.

what I require is to get the geocodes (i.e latitude and longitude) of the above google address as shown in json list

please let me know how to do this.

thanks

meghna

 
답변 1개
  1. 2019년 6월 13일 오전 6:31
    Hi meghna,

    First of all, you can save an external JS in static resource and import it in lightning component using ltng:require tag. Just go to this link : https://maps.googleapis.com/maps/api/js

    Save the page as .js file and upload it as static resource

    Having said that, there is some limitation from Salesforce side to use Google JS APIs in lightning components. I have an ongoing case with Salesforce for this and they are also not sure of any alternatives.

    I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

    Thanks,

    Ajay Dubedi
0/9000