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日 06: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