0
votes

I am working on a project wherin the GPS sends the latitude and longitude value of a place implicitly to google Maps API. I have come across the following link :

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false

In this, instead of directly specifying the latlong values, is there any way i can create a parameter "latlong" inside my program and could be passed to the google maps?

1
Can you show us what you have tried?Armand

1 Answers

0
votes

String latlng="40.714224 -73.961452"; String location[]=latlng.split(" ",",");

From the above code ,the latlng values will be spitted and stored in the form of arrays.When you want to specify URL.methion in the below form

"http://maps.googleapis.com/maps/api/geocode/json?latlng="+location[0]+","+location[1]+"&sensor=true

Then the remaining things is as usual i.e handling JSON data.I hope you are using the javascript or java.The above code will be helpfull for you.please ignore ,if this answer is not appropriate for you.

Thanks