google-direction

Plot polyline in Google Maps

眉间皱痕 提交于 2019-12-22 11:20:24
问题 I'm exploring Google Maps Direction API and noticed I get an overview_polyline -> points result. I was able to enter that value in the "Encoded Polyline" field here: https://developers.google.com/maps/documentation/utilities/polylineutility. The result seems to be the actual driving directions from start location to end location. The data looks right to me. I'd like to see this in a Google Map, but without all the map markers in between the start and end locations. How do I take this

How can I get directions for multiple waypoints with different transit methods using the Google Directions Service?

陌路散爱 提交于 2019-12-22 07:00:25
问题 So I understand how to use the Google Directions service to add waypoints and to change the transit mode but is it possible to do both with the same API call? I'm trying to get directions that will involve walking, then biking, and then some more walking but I'm not sure how to do it using one API call. I know I can split it up into a few but it will then force me to process Google's response vs using the setDirections method. These are the docs I'm going from: https://developers.google.com

Is there a way to avoid a specific road or coordinate in Google Directions?

放肆的年华 提交于 2019-12-20 04:54:16
问题 The API has a parameter for waypoints in order for The API to calculate the route ang pass through the specified waypoint/s. Is there any way where I could give the waypoints to avoid instead of waypoints to pass through? 回答1: It isn't (currently) implemented. There is an open feature request: Issue 214: Ability to influence Directions (e.g. "avoid" / "roadblock"). 来源: https://stackoverflow.com/questions/36272322/is-there-a-way-to-avoid-a-specific-road-or-coordinate-in-google-directions

track distance and time based on my track details

五迷三道 提交于 2019-12-18 13:49:27
问题 I am working on gps tracking in android to track the user location and provide the feature to record the track.I am able to draw path now i want to calculate the track distance and time with that like suppose user start tracking record and move to another location now i want to calculate total distance and time travel for from start to end position (with user location update) in google map. I have function which calculate the distance for 2 position but that not fit for my route, because

Google Directions API (Transit mode) returns only one alternative route per request

两盒软妹~` 提交于 2019-12-18 07:09:21
问题 I have built an small application which calls the Google Directions API in Transit mode. It works - nevertheless it returns only one possible route , so it shows no alternatives. Usually I expect 3-4 options to choose from. Example: http://maps.googleapis.com/maps/api/directions/json?origin=bieberstrasse,+dusseldorf&destination=norf,+neuss&sensor=false&mode=transit&departure_time=1399399424 The returned JSON structure has the expected "routes" array, but this array always has only one element

Is there a way to show road directions in Google Map API v2? [duplicate]

半世苍凉 提交于 2019-12-17 16:33:14
问题 This question already has answers here : Get driving directions using Google Maps API v2 (3 answers) Closed 8 months ago . I was looking for an answer using Google and here, and the only relevant posts I have found are: Google Maps Android V2 and Direction API Get driving directions using Google Maps API v2 but there is no answer there. So I have already mentioned it but I will say that again. I am looking for a solution for the Google Map API v2 using FragmentActivity and a

Array of destinations with google direction API

廉价感情. 提交于 2019-12-13 04:43:49
问题 I'm new to javascript and I have this problem with google directions : I have a table that contains the coordinates of different places like : lieux = [ {"nom": "place1", "icon": "galerie.png", "coordinates": [46.2018773, 6.1396896]}, {"nom": "place2", "icon": "galerie.png", "coordinates": [46.1989726, 6.1371983]}, {"nom": "place3", "icon": "galerie.png", "coordinates": [46.1976313, 6.1382951]}, {"nom": "place4", "icon": "galerie.png", "coordinates": [46.1997394, 6.1388766]} ]; I'd like to

Is there any way to wait until the DirectionsService returns results?

谁都会走 提交于 2019-12-13 03:58:45
问题 I have a problem with the Google DirectionsService. I know it's asynchronous and that is the cause of my troubles. I'd like to wait until the DirectionsService returns a result instead of executing code without an answer. Here is a sample: function snap_to_road (lat) { var position; var request = { origin: lat, destination: lat, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) {

Google Directions API Encoded Polyline

梦想的初衷 提交于 2019-12-12 09:14:41
问题 I am trying to map routes which should match the Google Maps street network. I know how to serialize the JSON result from the Google Maps Directions API. I am looking now at encoding the polylines from the individual routing steps. I have found some decoder algorithm here on stackoverflow but tested first Google's own Interactive Polyline Encoder. I would expect the encoded line to match the Google Map but it doesn't. The screenshot shows the result of an encoded segment in the Interactive

Google Directions Service w/ Waypoints returning ZERO_RESULTS

…衆ロ難τιáo~ 提交于 2019-12-12 06:48:21
问题 I currently have a DirectionsRenderer function that properly routes To and From fields on my page. After the routing is done I grab the overview_path and then load elements from a Fusion Table based on the path. Once this is done I've set up a listener looking for 'directions_changed', which would indicate a waypoint as such: google.maps.event.addListener(directionsDisplay, 'directions_changed', function(){ var wypnt = directionsDisplay.getDirections().routes[0].legs[0].via_waypoints.toString