-
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

Understanding Objects In Salesforce - All You Need To Know
It Takes 2 Weeks To Understand Objects in .Net and Java, But In Salesforce It Takes 2 min. Here Is How! In Salesforce, objects are…

Salesforce Standard APIs - All You Need to Know
Salesforce is becoming the #1 CRM tool and continually advancing with new features and functionalities that everyone wants to take benefit of eagerly. While working…

Essentials Question To Gauge Digital Transformation Of An Organization | Salesforce Guide
In an internet-driven world that demands an online presence to stay in tune with the evolving marketplace, every industry needs to keep up with the…
Popular Salesforce Videos
5 Things Salesforce Lightning Does Better
In this 30-minute recorded webinar, Jamie Grettum talked about her favorite Lightning features, how to set them up, and how to get hands-on experience with…
Login Flow In Salesforce
You can use a login flow to customize the login experience and integrate business processes with Salesforce authentication. Common use cases include collecting and updating…
Can Salesforce Developers and Consultants Choose Architect Track?
A Salesforce Consultant works to help companies meet their missions by driving client-specific implementation as well as ongoing system improvements on the Salesforce platform. The…