I am designing a google places implementation with google maps in my app.
If I query Google Places there is a limitation of 50000m or 50 km to the search radius.
Say I am in Spain I want to search for a place in Italy. How would I get returns for that from my search?
Thanks in advance.
You would need to set the location in your places query to be in Italy. You can use the geocoder to find convert the location to a LatLng
I guess I am trying to replicate the Google Maps search bar. So that
you just type in a place and it spits out the results. Is there any
way to do that with the Google Places API?
You can use Google Places AutoComplete API to do that. It uses a text based search like "Pizza in Italy"
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Pizza+in+Italy&types=geocode&language=fr&sensor=true&key=AddYourOwnKeyHere
Related
I want to use Google place autocomplete webservice: https://developers.google.com/places/web-service/autocomplete
to search for locations based upon a query (e.g. "High Street"). I also want the latitude and longitude of each place.
It seems that the only way to do this using the web service is to:
Perform an autocomplete search e.g.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&types=(cities)&language=en_GB&key=YOUR_API_KEY
Loop through each result and do a separate query for each location (see https://developers.google.com/places/web-service/details):
https://maps.googleapis.com/maps/api/place/details/json?placeid=PLACE_ID&key=YOUR_API_KEY
That means if I have 10 results, I have to do 10 additional web requests! That means 11 in total (1 for autocomplete, and 10 more for each place request).
This is very inefficient!
Surely there is a better way than this, as Google Maps on Android shows the distance of each place to your current location, indicating that the latitude and longitude is returned as shown by this screenshot:
Yes, for Places API, Directions API and Geocoding API that is the case. There is no other way.
you can use this API
of google APIs
https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&key=YOUR_API_KEY
I'm quite new to the Google Places API. What I want to achieve is create a simple search box where people can search places based on Google places, and choose one of them to get the coordinate (latitude, longitude).
Currently I'm using the Google Places API. All the steps are pretty straight forward, but after using it for a couple of day, I realize that sometimes the result from the Google Maps search box is better than the Google places API.
Below is what I test right now for Google Maps and the Google Places API
I test the result from the Google Maps search box with maps.google.com and see all the autocomplete.
I'm using the Google places API without any limitation in radius (orderby=distance), sensor is false, I put the user current location in the location parameters and the text into the keyword field.
Based on this configuration, the results are different. May I know if someone knows and would be willing to share how to configure the Google Places API URL to get the same results as with the Google Maps search box?
Or is it unachievable? That is, will the Google Places API search result not be as good as when we search in Google Maps? If so, is there any policy that does not allow people to only use the Google search box and the coordinate result without showing the map?
I believe Google Maps autocomplete uses a combination of results from the Place autocomplete and Query autocomplete services. Based on your mention of rankby=distance, it sounds like you're using the nearbysearch service, which will return somewhat different results from the autocomplete services. Have a look at the Google Places API documentation for the details of using the autocomplete services.
https://developers.google.com/places/documentation/
Here's what I need to do:
Say I search Google maps for france, and then for Rhode island. The radius of the map search results is much smaller for Rhode island than it is for france.
Is there a way I can get this radius information bases on a given search query from the Google Maps API?
You need to use the viewport which is returned in the Geocoder results.
https://developers.google.com/maps/documentation/javascript/reference#GeocoderGeometry
I need to find points that define delimitations of neighbors from Chicago.
My question is: How can I find a list with latitudes/longitudes of all the points that delimit neighbors. For example:
Gold Coast from Chicago is a polygon with 6 points as seen on google map: http://maps.google.com/maps/ms?ie=UTF8&t=m&vpsrc=6&source=embed&oe=UTF8&msa=0&msid=206241844247425110008.0004b43f0262868b8037f
What is the best way to extract this points so I can draw poly-lines over google map with google API for specific neighbors?
Edited:
So with addresses, which you already have, you can create a Maps API site:
http://code.google.com/apis/maps/
and use the Geocoding API to get the latitude and longitude of each of the addresses.
Added: Seems based on your comment that you're looking for neighborhood boundary data. Google Maps doesn't provide that data. There are different venders that do, one I have heard of is the Zillow Neighborhood API. I have never used it so I don't know much about it.
I'm writing a Google Maps mashup. I ask google the path from one location to another location. Google Maps gives me a Map with the route. I would like to take this route somehow and modify it (adding or removing points) before displaying it in the map. Is it possible? How would you do that?
Many thanks!
According to the Google Maps API Reference, there is a loadFromWaypoints function which will take waypoints in an Array and use them to calculate directions.
Edit: +1 for Cannonade. What he said.