google-direction

how to find the total distance traveled, based on geo points stored in database

…衆ロ難τιáo~ 提交于 2019-12-01 13:12:51
问题 Using an android app I am sending latitude and longitude values to database. This is my database Now in webpage I need to show the total distance traveled by K.Prathibha.N I've used Google Maps Direction API to find the distance but it is accepting 'id=2' as origin and 'id=5' as destination. But my motto is to find the total distance travelled i.e., id_2 to id_3 to id_4 to id_5. I am using while loop here. Code snippet: <?php $params_string=""; $pname = $_POST['name']; //name is passed from a

How to avoid both tolls and highways for Restrictions in Google Directions API?

痴心易碎 提交于 2019-12-01 13:03:39
Google Directions API allows us to attempt to avoid tolls by supplying the argument &avoid=tolls . Also, we can attempt to avoid highways by supplying the argument &avoid=highways . I was wondering how do I supply the arguments for avoiding both tolls and highways? Is it &avoid=tolls|highways or &avoid=tolls,highways ? &avoid=tolls|highways Search for "avoid=tolls|highways|ferries" on: https://developers.google.com/maps/documentation/directions/ I'm stuck on the "attempt to" avoid highways and tolls too. The docs clearly state "Note: the addition of restrictions does not preclude routes that

How to avoid both tolls and highways for Restrictions in Google Directions API?

有些话、适合烂在心里 提交于 2019-12-01 11:07:18
问题 Google Directions API allows us to attempt to avoid tolls by supplying the argument &avoid=tolls . Also, we can attempt to avoid highways by supplying the argument &avoid=highways . I was wondering how do I supply the arguments for avoiding both tolls and highways? Is it &avoid=tolls|highways or &avoid=tolls,highways ? 回答1: &avoid=tolls|highways Search for "avoid=tolls|highways|ferries" on: https://developers.google.com/maps/documentation/directions/ 回答2: I'm stuck on the "attempt to" avoid

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

梦想与她 提交于 2019-11-29 12:18:39
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. I have tried it with addresses in Brazil and Germany - it doesn't matter the country, I only get one

Directions API on Android

怎甘沉沦 提交于 2019-11-29 12:06:28
问题 While I was going through this blog, I got confused about using the Directions API on android. Is it possible to integrate the Directions API on the Map? To make it more clear, I am working on an application that would take in inputs from the users for things like source and destinations ... taking these inputs I would like to display an appropriate map having both the walking and driving directions depicted. Is just a JSON parser (or XML) enough to support this wish of mine, along with a

Array to create multiple routes on Google Maps v3

纵饮孤独 提交于 2019-11-28 00:21:36
I have a Google Maps project, and I want to do an array to create multiple routes using directions. For example, I click on the map and appear a marker named "A", and when I click the second time, display a marker named "B". Ok, this is working. But when I click the third time I want to display a new "A" point and the fourth time a new "B", don't need to erase the other route. I want only to display multiple routes, I know that I need to create an Array, but i don't know where i put the array, and etc. I will post here my code, if someone can create an example for me will be so helpful. This

Direction api: check if a place falls in the route path between 2 places

霸气de小男生 提交于 2019-11-27 20:16:08
I am using Google Direction API to plot the route path between 2 places A and B. I am able to do this. Now, I have a requirement to check if given a place C falls in the route path of A and B. Here is the snapshot of the route path that I have generated from my code. Here is the corresponding code: function initialize() { var input = document.getElementById('searchTextFieldSource'); var input1 = document.getElementById('searchTextFieldDestination'); var autocomplete = new google.maps.places.Autocomplete(input); var autocomplete1 = new google.maps.places.Autocomplete(input1); google.maps.event

Google direction route from current location to known location

烈酒焚心 提交于 2019-11-27 18:32:20
问题 I use the MapsActivity class in this project. On my map you can see many markers. I have many known locations, but in my code I just display two locations for example. I don't understand how to use the direction API and JSON. How can I display the route, distance, and travelling time from my current location (changing) to a known location (constant)? public class MapsActivity extends FragmentActivity { private GoogleMap mMap; // Might be null if Google Play services APK is not available.

Supply API key to avoid Hit Limit error from Maps Service in Apps Script

风格不统一 提交于 2019-11-27 15:52:18
I have a Google Sheet where we are fetching the driving distance between two Lat/Lng via the Maps Service . The function below works, but the matrix is 4,500 cells, so I'm getting the "Hit Limit" error. How can I supply my paid account's API key here? Custom Function function drivingMeters(origin, destination) { if (origin=='' || destination==''){return ''} var directions = Maps.newDirectionFinder() .setOrigin(origin) .setDestination(destination) .getDirections(); return directions.routes[0].legs[0].distance.value ; } Example use: A1: =drivingMeters($E10,G$9) Where E10 = 42.771328,-91.902281

How to decode the Google Directions API polylines field into lat long points in objective-C for iPhone?

早过忘川 提交于 2019-11-27 06:11:30
I want to draw routes on a map corresponding to directions JSON which I am getting through the Google Directions API: http://code.google.com/apis/maps/documentation/directions/ I have figured out how to extract the latitude and longitude from the steps field, however this doesn't follow curvy roads very well. I think what I need is to decode the polyline information, I found Googles instructions on how to encode polylines: http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html I did find some code here for Android and also Javascript on decoding the polylines, for