Google Places API - Finding nearest place, it's distance and travel time - google-maps-api-3

With the example below,
https://google-developers.appspot.com/maps/documentation/javascript/examples/place-search
I could get a list of stores nearby to pyrmont but i would also like to get the info of the store's distance from pyrmont and the approximate travel time by car & walk.
How could i get those info?

You'll probably want to use the Distance Matrix and/or Directions Service

Related

HERE Maps Api Reverse Geocode and Street/Road Bearing

Using HERE Maps Api, for a geographic coordinate (lat, lng), I would like to find address information for the nearest routable road. Information that includes:
Address (street, house number, city, postal code, country)
Bearing/Heading of the road (0 to 360 degrees from True North)
How can I achieve this through HERE Maps API?
So far, this is what I have been able to achieve:
Calling the calculate Route API with identical start and end endpoints and mode=car will force the API to snap to the nearest routable point. This step is necessary for when the input coordinates are for a pedestrian street.
Using the nearest routable point coordinates, I can call reverse GeoCode API and I will be able to find the address information I need.
The next step is where I'm currently stuck. I'm able to find information like direction=NW, however I can't find the ~exact bearing in grad, for example bearing=265.
Is this achievable? Are 3 steps really necessary or is there a HERE Maps API endpoint that can provide all of this?
You can use the Fleet Telematics API to get the headings value for a particular road. Read more about the api here - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
You can also look at the field explanationshere - https://tcs.ext.here.com/pde/layer?region=WEU&release=19111&url_root=pde.api.here.com&layer=ADAS_ATTRIB_FC1
HEADINGS Horizontal road heading [10^-3 degree] at coordinate points along the link, when driving from Reference Node. Comma separated. Each value is relative to the previous. No values here for the ref/nonref nodes, because they are in the separate fields REFNODE_LINKCURVHEADS and NREFNODE_LINKCURVHEADS.

Maps API is there a way to get available routes from A to B when they are the same?

So I want to find different walking routes where the start and end destination is the same. So If I as a user choose 5km, maps would show me routes that are about 5km long and start and ends at the same location. I have looked through the (messy) maps apis but haven't managed to find any endpoints for doing this.
You can do something like that by adding waypoints. So for a 5km walk you could generate a random point within 2.5 km of your start/end point and add it as a waypoint when generating directions.
Edit:
In addition you may try using the Geometry library in the Google Maps API. There is a computeOffset function which returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). This way you can add some waypoints relative to the start/end point. Or in close proximity to the random first waypoint.
https://developers.google.com/maps/documentation/javascript/directions#Waypoints

Find cities within one hour from my location

I want to use some Google API to find a list of places within one hour from my location. I've found Google Maps Distance Matrix API but it only gives you the distance between places you specify.
What I really want to do is to paint an area in a map, I don't really need the list of places.
If I can't query by time maybe I can deal with distance (which is probably easier)
Thanks a lot!!

Maps API 3 Directions with fuzzy via co-ordinates

I have a number of GPS co-ordinates that describe a route. My intention is to draw a polyline along the route, and then colour segments based on some data I have.
Problem is, the GPS coordinates can occur on the roadside either side of main roads. When using the obvious Directions service solution a lot of "back and forth" occurs as Google tries to get me either side of a split lane road
What I am aiming for is a direct route from A-H passing through every way point. I have considered reverse geocoding the coordinates to a street name and having the directions use the street as a way point, but that picks a specific point on the street that may not be related to the actual route. Single polylines are also not an option as some routes have turns in them.
Is there a way to 'fuzzy' my waypoints so that the directions are happy when passing within a certain radius of the points? If not, has anyone got any other solutions?
Thanks heaps.
Edit: It's also not an option to just not use the middle way points because sometimes the path is not optimal.
Also have tried my own fuzzy coords now, by +- some small value to each consecutive lat/lng pair. Unsurprisingly I ran into OVER_QUERY_LIMIT pretty soon.

How to nearby hotels using google places api based on driving distance

I know that I can search for hotels(for example) nearby a node by giving the radius of circle from the center node using google places api. But this returns places which are in other city. The reason is geographically the place is situated within the given radius. But the driving distance differs. Is there anyway to get around this?
The Places Search API will return places within a specified area ranked by prominence (popularity; "rankby=prominence"), or ranked by distance ("rankby=distance") independent of area. There is no option to rank by driving distance.
To get a ranking based on driving distance, you may want to consider using the Places Search API in conjunction with the Distance Matrix API.
https://developers.google.com/maps/documentation/distancematrix/
The Distance Matrix API will return driving, walking, or bicycling distances based on one or more origin locations, and one or more destination locations.

Resources