2
votes

The Google Reverse Geocode API returns a json response:

http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true

How do I get the lat/long out of it using JSON.NET on Monotouch ?

geometry": {
     "location": {
         "lat": 37.4220279,
         "lng": -122.0840677
}
3

3 Answers

1
votes

You can use the System.Json Classes.

You can find more about it here : JSON de-serialization with MonoTouch

1
votes

You will have to parse the JSON response returned by that URL and put it into a JObject. From there you can get the lat and lng via:

jObject.location.lat;
jObject.location.lng;

where jObject is the JObject instance.

1
votes

iOS has a built in wrapper doing this - MKReverseGeocoder.