-
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
How a Dedicated Salesforce Lightning Developer Can Upgrade Your CRM
Welcome to the future of customer relationship management! In today's fast-paced digital world, staying ahead of the curve is not just a choice but a…
Discover the Five Ways that Salesforce Creates Best Value CRM Year after Year
The Salesforce CRM and Sales integration architecture provide better deals following and continuous permeability, more fast-witted business choices as well as successful offering for an…
Popular Salesforce Videos
Custom Types in Lightning-datatable | Interchange | Salesforce Tutorial
First episode of our new Interchange series, in which we will deep dive in how to define custom types for a lightning-datatable component. Concretely, we’ll…
Different tools use to code in APEX | APEX Basics | Salesforce Development Course
Are you aware of the tools that are used for writing codes in APEX? Here are the different tools that you can use to write…
Salesforce Developer Career Path | How to Become Salesforce Developer
Watch this video to get a good idea about the Salesforce Developer Career Path. In this video you will learn how to become Salesforce Developer.…