-
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
Know The New Salesforce Lightning And Its Features
After Salesforce Classic, when the company released its new powerful platform, called Salesforce Lightning, it was announced that it will become future CRM and will…
CSV Files in Salesforce | Data Import | How-to Guide
Data Import: Clean and Prepare Your Data Using Excel, Data Import: Clean Up Your Import File Learning Objectives Data Import: Clean and Prepare Your Data…
The Journey Of Salesforce - Walking Down The Memory Lane
Salesforce is the most popular CRM, connecting businesses and customers in the digital age. Salesforce, which was founded in 1999, enables businesses of all sizes…
Popular Salesforce Videos
What is Validation Rule in Salesforce?
Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A…
Integrate Salesforce with External System using REST API
In this video, Path to Code explains the following topics: - What is API? - Introduction to REST API - Using cURL to consume Rest…
Custom Button URL Hacking in Salesforce Lightning Experience vs Salesforce Classic
Custom Button URL Hacking in Salesforce Lightning Experience vs Salesforce Classic Custom button URL Hacking approach in Salesforce Classic Custom button URL Hacking approach in…