json - Android direction in Google Maps with latitude and longtitude -
i want send origin point , destination point google direction. when use name origin , destination it's true , returns true json information, when send latitude , longtitude origin , destination doesn't work.
it's ok whit url: https://maps.googleapis.com/maps/api/directions/json?origin=tehran&destination=shiraz&key=aizasybvr07afm-1ddgvgt392lrnuge3wet6nuy
but doesn't work this: https://maps.googleapis.com/maps/api/directions/json?origin=32,52&destination=34,54&key=aizasybvr07afm-1ddgvgt392lrnuge3wet6nuy
i think problem coordinates you're using - they're not accessible via roads. make sure you're not casting latitude or longitude ints, need decimal-point precision.
converting tehran , shiraz latlngs, following url works correctly:
https://maps.googleapis.com/maps/api/directions/json?origin=35.6887931,51.3891646&destination=29.5916593,52.583701&key=<api key here>
Comments
Post a Comment