-
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
Introduction to Salesforce Communities: Licenses and Benefits
What are Salesforce Communities? Salesforce is a San Francisco based organization that gives client connection to the board (CRM) programming arrangements. Most importantly, Salesforce people…
A Guide to Listing App or Product on Salesforce AppExchange
To create a Salesforce App, coding experience is not mandatory. Apex and JavaScript are the key languages used in Salesforce App development. However, one can…
Top Salesforce Features for Developers to Try Out in 2022
With Spring ‘22 release, there’s a lot that’s new for Salesforce developers that they can look forward to. The release has come up with some…
Popular Salesforce Videos
How Do All Salesforce Products Come Together
The products of Salesforce run completely in the cloud. Therefore, the companies don’t need to fret about costly maintenance and setup charges. Additionally, cloud technology…
Enterprise Architecture in Salesforce
Enterprise Architecture in Salesforce 0:00 Introduction 3:24 What is Enterprise Architecture? 5:11 Why do we need Enterprise Architecture? 7:00 EA Methodology 11:37 Business Strategy 15:15…
Salesforce Admin Certification 2020 Questions Explained with References - Part I
How to prepare and pass Salesforce Admin Certification with Practice Exam Questions 2020 practice questions and answers for the Salesforce Administration Salesforce Certified Admin Exam…