Skip to main content 2025-2-1부터 2025-2-2까지 Trailblazer Community를 이용할 수 없습니다. 이 기간에 맞추어 활동을 계획하세요.
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