-
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 Variable Types Operate in the Lightning Component Framework
When writing a component or application, you can set an attribute to have a specific type. But how is the type being used by Aura,…
Top Sales Challenges in 2023 Which Salesforce Sales Cloud Can Solve
There’s no denying the fact that a sales job is full of challenges. Sales managers are constantly on the lookout for ways to optimize their…
Demystifying Salesforce Blockchain
Salesforce is always a company that is looking ahead to the next big in technology, whether it is mobile, social, IoT or Artificial Intelligence. The…
Popular Salesforce Videos
Object Oriented Programming - Salesforce Developer Tutorial
In relation to programming languages, object-oriented means that the code focuses on describing objects. An object can be anything that has unique characteristics, such as…
Salesforce Training Videos For Beginners - 1 | Salesforce Administrator Training
This Salesforce Training Video will help you understand which is the easy and best tool for CRM, Branding, tabs and homepage optimization. This is an…
Set Your Sales Cloud Implementation Up for Success
Make Sales Cloud a valued business tool that your sales reps will rely on by starting with these planning strategies and best practices for success.…