get path form google in json/xml/kml format - iphone

HI....
How can i get route in the form of file or xml/kml/json format ??
Means I want to fond all the latitude and longitude between two location and i want to draw path on map.
path i can draw but i am not able to get all the latitude and longitude so can any body help me???

Try appending "&output=kml" or "&output=json" to the end of your Google query URL.
Related Stackoverflow posts:
Accessing Google Map Listing From GData
Search and display business locations on MKMapView

Related

How to display nearby locations using Google Places API as a list (without a map) for a flutter project?

I'm building a flutter app which should show the nearby locations of the user as a list. I have used locations plugin to find the user's location, which now returns latitude and longitude.
Is it possible using this information (lat & long) to show the nearby locations as a list, not using a map?
Sure. You can use Google Places API :
Use location property to pass lat and long.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&key=YOUR_API_KEY
Yes its possible, use Google Places API
https://developers.google.com/places/web-service/search
Use location property to pass lat lng as suggested in the documentation link provided.

To get latitude and longitude from user given location

In my app the user gives the location name for eg: "New York". in the text field, app gives the location ie latitude & longitude of New York.
Which method I should use . please help me.
Thanks.
You can use this Google Geocoding API below,
http://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&sensor=false
In the place of address=Winnetka you can write address= New York,
You will get the lat and long in the xml responce so just parse the output.
Enjoy!
You can also use the Places Autocomplete API, which you may find useful.

Google Geocoding API not returning correct latitudes,longitudes for address as returns in google maps

I am facing a strange problem of google geocoding API.
My requirement is whenever a user types any address all the corresponding locations should show in my map View(I am using MKMap View) like it happens in google maps.
So what I do is I use google geocoding API that returns me a list of latitudes and longitudes for that corresponding location.
But for some location eg:- caribou coffee, chapel hil (When I search for this location in google maps,I get a number of annotations showing that address but when I type this address in geocoding I didnt get nothing.
request url:-http://maps.googleapis.com/maps/api/geocode/xml?address=caribou%20coffee,%20chapel%20hil%20&sensor=false
response:-
-<GeocodeResponse>
<status>ZERO_RESULTS</status>
</GeocodeResponse>
Can any body tell me why I am not getting any latitude and longitude that correspnds to this address like it shown in google maps or there is some other way so that I can integrate the behaviour of google maps in my applications(mk map view).
Please help me as I am stuck here.
Any suggestions will be highly appreciated.
Thanks in advance!
Note that the address is incomplete - e.g. searching for caribou coffee, chapel hill, nc does produce a result.
I would think that Geocoding API can't do anything with such addresses, and you may need to use some extra API - e.g. Places API (https://code.google.com/apis/maps/documentation/places/ ), which can return some results for queries like "coffee". You'd need to supply the user's location to use as a base, however.

Convert UK Postcode to Lat / Lng in Objective-C iOS iPhone etc [duplicate]

This question already has an answer here:
Retrieving Current Location and Zip using Geolocation Button
(1 answer)
Closed 5 years ago.
I am wondering how I can convert a UK Postcode to Lat / Lng within my app so that I can pass this onto a URL.
I am parsing my data as JSON to be used later in a map
eg: http://www.thebigfishexperience.org.uk/sources/ajax/venue-json.php?lat=52.5612743&lng=-0.2732938&radius=10
The lat and lng parameters would be generated by the app and would push to something like the above.
If you have postcode, you need to do reverse geocoding but that can be done using MapKit. Check this iPhone Development – Reverse Geocoding
If you do not want to use MapKit, you can request to url http://maps.google.com/maps/geo?q=UKPOSTCODE&output=xml, and parse xml, you will get latitude longitude.
To convert a UK postcode to a Latitude and Longitude, use Google's Geocoding API.
http://maps.googleapis.com/maps/api/geocode/json?address=POSTCODE&sensor=false
You will receive a JSON response which you can easily parse to populate your hidden fields.

how to get country location on Google Map in iphone using Country name only?

In my iphone application i have integrated Google Map.I want to show the country location on Google map using only country Name Only.(Not needed to use its latitude and longitude).The input only will be the country name?(i.e India) to the google Map and Map will locate it with indicate pinpoint.
Is it possible to locate the country using the country name in google Map?
Is any body has any solutuion or code snippet or any useful link,which would be appreciated.
Thanks,
Mishal Shah
There is no geocoder in the iPhone SDK at this time. You'll have to use a library likes http://developers.cloudmade.com/wiki/iphone-api/Geocoding_iPhone_example or call Google geocoder API, Yahoo etc.