google-maps-direction-api

How to use Google-Directions-Android library with a restricted API key

≯℡__Kan透↙ 提交于 2020-04-03 09:44:59
问题 I am new to Android and working on a google map project. For this I am using this library to draw a route between two points. This works fine when there is no restriction on the google map api key. But when restriction is applied to my app's package name and sha1 key it won't show the route. It throws an exception saying: This IP, site or mobile application is not authorized to use this API key. Request received from IP address XX.XX.XXX.XXX, with empty referrer Is there any way to use this

How to use Google-Directions-Android library with a restricted API key

泪湿孤枕 提交于 2020-04-03 09:41:45
问题 I am new to Android and working on a google map project. For this I am using this library to draw a route between two points. This works fine when there is no restriction on the google map api key. But when restriction is applied to my app's package name and sha1 key it won't show the route. It throws an exception saying: This IP, site or mobile application is not authorized to use this API key. Request received from IP address XX.XX.XXX.XXX, with empty referrer Is there any way to use this

How to use Google-Directions-Android library with a restricted API key

不问归期 提交于 2020-04-03 09:39:10
问题 I am new to Android and working on a google map project. For this I am using this library to draw a route between two points. This works fine when there is no restriction on the google map api key. But when restriction is applied to my app's package name and sha1 key it won't show the route. It throws an exception saying: This IP, site or mobile application is not authorized to use this API key. Request received from IP address XX.XX.XXX.XXX, with empty referrer Is there any way to use this

Google Direction API and Google Maps App showing different routes for same destination

浪尽此生 提交于 2020-01-10 06:07:09
问题 I am working on an app in which I have to show shortest route. I am using Google Direction API but the result is different from Google Maps app for same destination and travel mode. https://maps.googleapis.com/maps/api/directions/json?origin=19.107163,72.862375&destination=19.106995400000002,72.8643029&sensor=false&mode=driving&alternatives=true&key=XXXXXXXXXXXXXXXXXX Since alternative is true I am already using shortest route from available routes (response). Note : - When I enter lat lng of

Google Direction API and Google Maps App showing different routes for same destination

核能气质少年 提交于 2020-01-10 06:06:25
问题 I am working on an app in which I have to show shortest route. I am using Google Direction API but the result is different from Google Maps app for same destination and travel mode. https://maps.googleapis.com/maps/api/directions/json?origin=19.107163,72.862375&destination=19.106995400000002,72.8643029&sensor=false&mode=driving&alternatives=true&key=XXXXXXXXXXXXXXXXXX Since alternative is true I am already using shortest route from available routes (response). Note : - When I enter lat lng of

How do we get the shortest distance route from point A to B by default from Google Direction API

北城以北 提交于 2019-12-21 04:04:34
问题 How do we get the shortest distance route from point A to B by default from Google Direction API suggested alternative routes? By default it gives us shortest duration routes depending upon the current traffic conditions. I have noticed that google responds with multiple alternative routes if you turn on "provideRouteAlternatives=true", I was wondering if we could send a parameter to Google API so that it will always return shortest distance route by default 回答1: As Rameshwor has mentioned,

How do we get the shortest distance route from point A to B by default from Google Direction API

大城市里の小女人 提交于 2019-12-21 04:04:28
问题 How do we get the shortest distance route from point A to B by default from Google Direction API suggested alternative routes? By default it gives us shortest duration routes depending upon the current traffic conditions. I have noticed that google responds with multiple alternative routes if you turn on "provideRouteAlternatives=true", I was wondering if we could send a parameter to Google API so that it will always return shortest distance route by default 回答1: As Rameshwor has mentioned,

Google directions api overview polyline not working

微笑、不失礼 提交于 2019-12-18 09:38:14
问题 I'm trying to show a path from the google maps directions api on a google maps static map. The url for the directions api call looks like this: https://maps.googleapis.com/maps/api/directions/json?origin=lübeck&destination=hamburg&key=MY_API_KEY I get a valid json response containing all the informations. I then want to show the encoded polyline for the path overview on a static map with this api call: https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=860x600&path=enc:THE

Google Directions Api returning 0 routes

谁说我不能喝 提交于 2019-12-17 14:53:23
问题 We are calling the google directions api to calculate round trip values. In general it works perfectly. I have however come across a use case where it fails to come up with any route. However when we use the js google.maps.DirectionsService version with the same origin, destination, waypoints, and travelMode it works. The failing call is: https://maps.googleapis.com/maps/api/directions/json?origin=-33.92873,18.458879&destination=-33.92873,18.458879&waypoints=via:-33.9403,18.666731&mode

google maps javascript is fetching the route but not the json api

大兔子大兔子 提交于 2019-12-12 03:48:26
问题 I have stumbled upon this: when I use directionsDisplay.getDirections() API to fetch and display the results, it works, but when I do it via json: https://maps.googleapis.com/maps/api/directions/json?origin=place_id:ChIJR0FT51wiDogRNuVKiLn9ZLA&destination=place_id:ChIJMWaiY0YpTIYRRdGvCMg7m0g&key=MY_KEY&waypoints=via:place_id:ChIJaWS37r88DIgRu-ak1l7eXAQ I get "status" : "ZERO_RESULTS" I am wondering why this might be happening? Any ideas? 回答1: Remove the "via:" keyword from the waypoints to