google-direction

Google Directions API Encoded Polyline

天大地大妈咪最大 提交于 2019-12-04 21:43:10
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 Polyline Encoder on the left and the result from a Google Maps route on the right. The encoded polyline

Android Draw polylines with arrow on google map with direction path

情到浓时终转凉″ 提交于 2019-12-04 13:13:50
问题 I have added polylines but not able to add arrow with direction on google map should be display as below And when it zoom up, more arrow should be display like below I have tried reading various blogs and codes but not able to get the goal I have used following code snippet below: private void DrawArrowHead(MarkerOptions MO, GoogleMap mMap, LatLng from, LatLng to) { // obtain the bearing between the last two points double bearing = GetBearing(from, to); // round it to a multiple of 3 and cast

Travel Distance between two Lat and Long

百般思念 提交于 2019-12-03 12:53:12
问题 I am looking to calculate and give the distance between two sets of Lat and Long for travel on Road. I have had a look at the Google's Directions and Distance Matrix API. And also done a lot of other questions on SO. But i am not able to figure out the best possible way to do it, you need to calculate the distance to around 20-25 locations at each time. We are building a travel app that requires this information for the user on Android device from where he is. 回答1: If You are looking for

Android Draw polylines with arrow on google map with direction path

岁酱吖の 提交于 2019-12-03 08:20:45
I have added polylines but not able to add arrow with direction on google map should be display as below And when it zoom up, more arrow should be display like below I have tried reading various blogs and codes but not able to get the goal I have used following code snippet below: private void DrawArrowHead(MarkerOptions MO, GoogleMap mMap, LatLng from, LatLng to) { // obtain the bearing between the last two points double bearing = GetBearing(from, to); // round it to a multiple of 3 and cast out 120s double adjBearing = Math.round(bearing / 3) * 3; while (adjBearing >= 120) { adjBearing -=

Travel Distance between two Lat and Long

若如初见. 提交于 2019-12-03 04:04:10
I am looking to calculate and give the distance between two sets of Lat and Long for travel on Road. I have had a look at the Google's Directions and Distance Matrix API. And also done a lot of other questions on SO. But i am not able to figure out the best possible way to do it, you need to calculate the distance to around 20-25 locations at each time. We are building a travel app that requires this information for the user on Android device from where he is. If You are looking for driving distance NOT shortest distance then You can try to call API service with URL like: http://maps

Change Google map marker orientation according path direction

≯℡__Kan透↙ 提交于 2019-12-02 18:38:16
问题 I'd like to know if it possible to change the marker orientation according the path drawn on the map. Here is a example: As you can see the marker is a car (with front bumper and tail lights). I'd like to orientate the car in the direction the path is going (in this exemple orientate the car around 45 degrees to the right). I'm using DirectionsService to draw the path and I have a random number of point. Sometime only one, sometime 10 points. I'm adding the markers before drawing the paths.

Google Maps Directions url error when adding multiple waypoints

本秂侑毒 提交于 2019-12-02 18:22:50
问题 I am trying to add multiple waypoints to my google directions request. When I add a single waypoint like https://maps.googleapis.com/maps/api/directions/json?&origin=51.507679,-0.125004&waypoints=51.524151,-0.123174&destination=51.495777,-0.108642&mode=walking it works fine but when I try to add multiple waypoints like https://maps.googleapis.com/maps/api/directions/json?&origin=51.606502,0.527309&waypoints=51.507679,-0.125004|51.524151,-0.123174&destination=51.495777,-0.108642&mode=walking i

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

心已入冬 提交于 2019-12-02 03:25:55
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? 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

Google maps directions and area near route

瘦欲@ 提交于 2019-12-01 14:51:51
How I can do something like here in image with google map, Is anybody know ho to do this. So here is directions and area near route directions (green opacity area) I would approach this by using the Directions API and getting lat/lng of each step . I would then use the Polygons API to draw circles of a chosen radius, every x meters along a straight path following the steps . EDIT: A better solution would be to use the steps with a Polyline , and give it a sufficiently thick strokeWidth 来源: https://stackoverflow.com/questions/18514190/google-maps-directions-and-area-near-route

Google maps directions and area near route

蹲街弑〆低调 提交于 2019-12-01 13:32:07
问题 How I can do something like here in image with google map, Is anybody know ho to do this. So here is directions and area near route directions (green opacity area) 回答1: I would approach this by using the Directions API and getting lat/lng of each step . I would then use the Polygons API to draw circles of a chosen radius, every x meters along a straight path following the steps . EDIT: A better solution would be to use the steps with a Polyline, and give it a sufficiently thick strokeWidth 来源