I am currently working on a project using the google maps JS API. i would like to display the place type in a similar fashion to how a google search would result (example below).
Using the getDetails method in PlacesService (as show here), i can receive an array of types for a place, yet they are not descriptive as what a google search shows, and are not localized. is it possible to achieve using the API?
Currently, the API doesn't provide this information.
There are a couple of feature requests in the Google issue tracker that might match your requirement:
https://issuetracker.google.com/issues/35822953
https://issuetracker.google.com/issues/35827225
You can star these feature requests to add your vote and subscribe to further notifications.
I would like to use the Google Places API to search businesses that are unclaimed in specific areas. I think this would be a cool project. Is there another way to do this perhaps by scraping? I have been trying for weeks and I cannot seem to figure this out.
You cannot.
There is no intention to make owner details available at the API, as that would be a honeypot for spammers. More details on the feature request: https://issuetracker.google.com/issues/35819976
Google Maps API allows you to avoid tolls, ferries, and other such common annoyances. Is there some way to have the routing engine avoid specific places? I want to take a list of places from the Places API and then create a route that avoids them ... sort of the opposite of waypoints.
Possible? Or do I need to write my own algorithm for this?
It's basically a yes/no. Either the routing engine can take this info (show me how), or it can't. Apparently the answer is "No, it can't" according to the comment below and this is now solved.
Feature request in the issue tracker:
Issue 214: Ability to influence Directions (e.g. "avoid" / "roadblock")
I want to use Google Places Autocomplete API to provide search-while-typing for an Android app.
the Autocomplete API returns IDs and References, requiring an iteration through the results to get the details (such as name and geometry) for each place, this is slow and results in a bad user experience. also, many API calls are done for each key press.
is there a better way to provide such searching capability with Google Places ?
Is there a reason you need to have the geometry for each possible autocomplete place after each keypress of the API? Showing this seems like generally it would not be a great user experience, and is not what the Autocomplete API was designed for.
In theory the name (description) should be enough for the user to decide which item they're interested in, and then after a user has actually selected something you can request additional details as needed.
On the other hand if you already have some information about the name of the place, you could use the Places API (not Autocomplete) to get additional details of matching nearby places:
https://developers.google.com/maps/documentation/places/#PlaceSearchResponses
Is it possible to use the Google Maps API router just using HTTP? Something like http://maps.google.com?from=blah?to=blah
And have it return some sort of XML or JSON representing the directions?
If you want Google to allow legal access to driving directions via HTTP you might consider voting for the enhancement request: Issue 235. Theoretically, the more people that vote for an enhancement request, the more attention Google give to it.
However, I strongly suspect that there might be contractual issues with the organisations that supply the data. Organisations like TeleAtlas impose restrictions about how Google can use their data. TeleAtlas probably don't want Google to make it legal for people to use their data to create apps for free that directly compete with their own commercial apps and devices.
There is no documented and approved method to access driving directions via an HTTP API request.
This makes it difficult to get driving directions on the server-side, which I assume is your intention.
Not only it is undocumented and difficult to achieve, but it would also violate the restrictions 10.1 and 10.5 of the Google Maps API Terms and Conditions.
However, if you don't mind the challenge, and you believe that rules are there to be broken, you may want to check these articles:
Calculate driving directions using PHP?
Retrieve driving directions from google maps with server-side HTTP calls and show results with static maps for WAP
Actually yes, and they do it themselves
The REST format is like:
http://maps.google.com/maps/nav?output=js&q=from:%20Montreal%20to:%20Toronto&key=apikey
Where q should have the form: "from: x to: y" (url encoded).
Some of the parameters are similar to the HTTP Geocoding service: http://code.google.com/apis/maps/documentation/geocoding/index.html
Mike
As of May, 2010, directions are available via web services:
http://code.google.com/apis/maps/documentation/directions/
Directions are returned in XML or JSON format:
http://maps.google.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
http://maps.google.com/maps/api/directions/xml?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
It's pretty danged easy to use.
Here you can find a list of parameters you can pass to the maps.google.com URL. Maybe you'll be able to get the information you need. I don't know what the returned output contains. At least you are able to define different output types.
I have already used this library with python and it works well, although it's against Google Maps API Terms.
API v3 (made the official version in the last six months), does:
http://code.google.com/apis/maps/documentation/directions/
Also note that most of the competing services (Bing Maps, Yahoo, MapQuest, CloudMade, etc) also support RESTful web services along these lines.
As always with these services, check the Terms & Conditions.
I've never used the API but it is pretty easy to get the structured directions data from a google maps page using JS to access the gmap page's DOM.