-
What is the best way to parse the JSON response that comes from google map?
Hi All,
What is the best way to parse the JSON response that comes from google map?
JSON Response:
up vote1down votefavorite
I've written something that will get the longitude and latitude from a Google Geocode Callout.The response we get from a generic callout looks like this:
{
results=( {
address_components=( {
long_name=1600,
short_name=1600,
types=(street_number
)
},
{
long_name=Amphitheatre Parkway,
short_name=Amphitheatre Pkwy,
types=(route)
},
{
long_name=Mountain View,
short_name=Mountain View,
types=(locality,
political)
},
{
long_name=Santa Clara County,
short_name=Santa Clara County,
types=(administrative_area_level_2,
political)
},
{
long_name=California,
short_name=CA,
types=(administrative_area_level_1,
political)
},
{
long_name=United States,
short_name=US,
types=(country,
political)
},
{
long_name=94043,
short_name=94043,
types=(postal_code)
} ),
formatted_address=1600 Amphitheatre Pkwy,
Mountain View,
CA 94043,
USA,
geometry= {
location= {
lat=37.4223582,
lng=-122.0844464
},
location_type=ROOFTOP,
viewport= {
northeast= {
lat=37.4237071802915,
lng=-122.0830974197085
},
southwest= {
lat=37.4210092197085,
lng=-122.0857953802915
}
}
},
place_id=ChIJ2eUgeAK6j4ARbn5u_wAGqWA,
types=(street_address)
} ),
status=OK
}Thanks
Log In to reply.
Popular Salesforce Blogs

4 Ways a Customer Portal Makes Salesforce & WordPress a Winning Fusion
Customer Relationship Management (CRM) is synonymous with the brand Salesforce. It’s the first name that pops up whenever there is any chatter about CRM. They…

Building Your First App for Salesforce AppExchange: A Step-by-Step Solution
Are you looking to build an application for Salesforce AppExchange? You must be familiar with Salesforce and how it works. Knowing the platform's capabilities can…

Managed Services: A Better Way to Administer Salesforce Deployments
Consistent support and ongoing innovation are keys to a profitable Salesforce CRM. But keeping ongoing support for Salesforce requires a substantial portion of your investment…
Popular Salesforce Videos
Salesforce Developer Tools and Productivity
Kevin Poorman shows how you can use Salesforce Developer Tools and how you can unlock developer productivity. Watch this video to learn more.
How To Create a Dashboard in Salesforce CRM Analytics (Tableau CRM) From Scratch | Part 1 - Dataset
Salesforce CRM Analytics (formerly Tableau CRM) is a powerful tool for data analysis and visualization. The foundation of any CRM Analytics dashboard is a dataset.…
Salesforce Apex Rest API Integration
As you know salesforce is an online cloud solution, we might be required to integrate Salesforce with some other third party tool. We have released…