-
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
Boost Fundraising With Salesforce Nonprofit Cloud Implementation
Trusted by more than 150,000 customers globally, Salesforce is one of the most popular and go-to CRMs for corporates and enterprises. It empowers organizations to…
Learn All About Salesforce Integration With Heroku
What is Heroku and How Does it Help in Integration? Salesforce can be integrated with any application that is used on a day-to-day basis. Most…
How to Use Workbench in Salesforce | Developer Guide
Workbench can be a web-based tool that helps administrators and developers to act with Salesforce for information Insert, Update, Upsert, Delete, and Export. It in…
Popular Salesforce Videos
Client Side Search in Lightning Component Salesforce | Lightning Data Table
In this video, I will implement the Client-Side Search functionality in Lightning Data Table in a Custom Lightning Component. Client-Side Search allows users to search…
Difference between Profile and Roles in Salesforce
Learn about the difference between Profile and Roles? Watch this video and do let us know if you have any questions or concerns.
Salesforce Staff Has Option to Keep Working From Home
Dan Bognar, head of the strategy for Asia at Salesforce.com Inc., discusses how the coronavirus outbreak is affecting the San Francisco-based software maker’s operations and…