my question is about google maps json output.
i've here a start address and end address :
Google Maps Link
And at the following link, i display the result as json format :
Google Maps Json Format
It displays only one legs(route), but from start address to end address i've 4 routes.
My question is, how can i display all routes in my json output?
Can you help me?
Thanks in advance.
Add a parameter alternatives=true to the URL:
http://maps.googleapis.com/maps/api/directions/json?origin=M%C3%BCnchen%20Hauptbahnhof,%20Bayerstra%C3%9Fe%2010A,%2080335%20M%C3%BCnchen,%20Deutschland&destination=Landshuter%20Allee%2033,%2080637%20M%C3%BCnchen,%20Deutschland&sensor=false&departure_time=1343605500&mode=transit&alternatives=true
Related
I am sending the following request to the google autocomplete api in attempts to get a street address with the zip code included.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=917&component=country:us&key=[MyApiKey]&types=address&bounds=defaultBounds&stricktBounds=true&address_components=postal_code&fields=address_components
I can't seem to figure out how to ask for the zip code in the query parameters. When I pass a full address with the zip in the input, google returns the zip code, but I would like it to always return the zip code.
I can make another request to the google maps api and pass the place id that I get from the autocomplete endpt and get the full address with the following request.
https://maps.googleapis.com/maps/api/place/details/json?fields=formatted_address&place_id=Eic1MDEgQ29sbGVnZSBBdmVudWUsIEdyZWVuc2Jvcm8sIE5DLCBVU0EiURJPCjQKMgldGdoYQBlTiBEjv0Tw4tNAARoeCxDuwe6hARoUChIJVXM4RSQZU4gRLNRdpst7vxAMEPUDKhQKEgmVWLxpQBlTiBGKDjnnY2NAzg&key=[my_Key]
But I would like to do a search and get the zip code all in one request.
Edit:
The following works in javascript with the google api javascript package, but I cannot use javascript in my project...
https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?1s501&fields=formatted_address&key=[my_key]
Thanks for any help!!
The google api place textsearch endpoint can be used instead with field type formatted_address to return the zip code.
https://maps.googleapis.com/maps/api/place/textsearch/json?query=971&fields=formatted_address&inputtype=textquery&key=[my_key]
i've a question about Google Maps Public Transportation, i want to fetch all data from Google Maps to my smartphone. I've here an url, that gives me the data as json format.
JSON :
JSON Output
Google Maps:
Google Maps
But i can't see the stations in json file. Following image shows the stations names(marked in yellow).
How can i get the all station names in json format?
Thanks in advance.
I have been able to retrieve little infos (mainly email and id ) in JSon using Oauth2 the url:
https://www.google.com/m8/feeds/contacts/default/full?&max-results=5&alt=json
Now I want more details like name/ phone number . Is it possible in one call with one url ?
Thanks
I think you may be using the google example code. The information you need is retrived by this url, part of the example code is wrong, it seems like the information is not retrived.
You'll find these stackoverflow links useful:
Google Contacts API XML parsing with PHP
Fetch Contacts from google
i found out that i can open google maps with a linkt to a kml-file like that:
http://maps.google.com/maps?q=http://econym.org.uk/gmap/example1.kml
that is exactly what i need, but i don't like to provide a public URL with the Data. Is it possible to pass the data with a post request or get parameter?
Or has anybody another idea how to create a link to google maps with multible markers?
Thanks in advance
Updated based on your comment: You could upload the KML to a Google My Map: maps.google.com->My Places->Create Map->Import. There isn't currently programmatic access to My Maps. Otherwise, maps.google.com requires a public server to host the KML data.
how to parse json response that we get from google map api and how can we show the particular location on map.
suppose i have entered one location name(i.e NewYork) and for that i have received json response,how can i show it on the map.
please provide help as i have never used google map api and json also.
Whole bunch of examples here: http://code.google.com/apis/maps/documentation/javascript/v2/demogallery.html
My advice? Find the simplest one closest to what you want to do and view source.
Edit: missed the j2me tag. This advice is inapplicable. Sorry about that.