android - How to get polyline from Google Maps Directions Api -


i'm trying draw using google maps directions api, how use json values make this, because in api, there lot of lat , long , polylines.points this:

cxwnftdct@jevglcr?pdtfnhtnnnpjpdrdn?jchcv@i@vqtk`ckf

and don't know 1 should use, can me :)

{   geocoded_waypoints: [     {},     {}   ],   routes: [     {       bounds: {         northeast: {           lat: 39.2846595,           lng: -8.7036795         },         southwest: {           lat: 38.7223249,           lng: -9.1393372         }       },       copyrights: "dados mapa ©2017 google, inst. geogr. nacional",       legs: [         {           distance: {},           duration: {},           end_address: "lisboa, portugal",           end_location: {             lat: 38.7223249,             lng: -9.1393372           },           start_address: "santarém, portugal",           start_location: {             lat: 39.2846595,             lng: -8.7049071           },           steps: [             {               distance: {},               duration: {},               end_location: {                 lat: 39.2822117,                 lng: -8.7036403               },               html_instructions: "siga <b>sul</b> em direção <b>n3</b>",               polyline: {                 points: "cxwnftdct@jevglcr?pdtfnhtnnnpjpdrdn?jchcv@i@vqtk`ckf"               },               start_location: {                 lat: 39.2846595,                 lng: -8.7049071               },               travel_mode: "driving"             },             {},           ],           traffic_speed_entry: [],           via_waypoint: []         }       ],       overview_polyline: {   points:"cxwnftdct@daqlaf@faf@|aq@l@]pccfhcja|lfjlat~@ipdi@jab@f@hxi@t@kbhbebx@qz@z@dclhzfpw`h|rvtpj@`axadbdanaxhb?fbk@racang_hhcgajakratba`al@lbhnac@rfgbhikcxmbfilbvhnbtcnb|anedcrjxfj@fb@h@ohagcthgfcl@jala\je]tdbzbb@tlxftk~e`d@hshizetdhdxdrefdpflfjnvdtrddjthf`tzh`qhehg|evfhl`jpjte|lpedopfjozglpfjlhze~njlfqvpfp|rthrkxdjgfi|ndhbovgjpfcbhpctivjh_@vg|[|ctnvfvsve~mfi|qzlbtfnxqbklkrrzp|nnnvnlqjizmnlfv`t|h@ndbhhidmxfjh~jrmnefhzirqfhvoteji|mnqfnzp`fzi~enlrkp[ndlhverhzl~mbrbm`ejcjfxetrnx|d~ejihi~wrrxglgdfng`jjnxhzkftxvfkfrfmbrlerhtblfxijyvhnppbtfxf~wpcjhjghjfdzclf~cndlardl@pc\vhxvx[loab|gcbdfqbxqwjbdmaxe_apj_@jextitbrq~ebqbdlufbpmfa|ixcbf`dhglgnjjktjrf`spfbrndduxabgralejbnfpdtnnmfgle~[ltbrdqjtpuxh`gjhfenglc`o|druxenezaffrbnspijpndxslaf\lal~@hdzrrajopbvkrbrqtev^pm``@rprr|jxsdmlgngfgth~hxfdflbtgfapgp@bg|anhxd|fzfrh`l~fvh|hrfrftbtfja~mt@phr|fha`ifdpebdzfxgrhrkheterf`ens`mzmvitsduff~dte~b|srinenbzdtcxn`qpqfvtq~yjn@~fank`rvllrzejf|glfrc@vufrjkfivgxdhejixkdn~t`l~mrfve~lhilp@fb@xctbzftfbezfbdrghh`tff|jngfhzedd|udiptdhtktfj]nurezc~[ptflfg|ebb~kfcntvdpmaxszs@~lhofdzodffoxgdy`o`k@zynvzmlk|hrfjfbxj[rcbcvdfb|ffbbd^xrblb@nbridarjvdfd|b|fzfvfzhncbidrck@da_a_@q@mhz@savaj^f@r@n@x@ur_@fbgjet`s~@ro@pcpxpaffp@dehcngte@hxl@n@h^w|aspshabzxatpp@~sjazgzkddstbd@x@dc@nevz@htap@b@\oz|abbxdnfjf@"       },       summary: "a1",       warnings: [],       waypoint_order: []     }   ],   status: "ok" } 

convert overview_polyline list of latlng , add polyling in map

use polyutil provided google.

https://github.com/googlemaps/android-maps-utils/blob/master/demo/src/com/google/maps/android/utils/demo/polydecodedemoactivity.java

https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/polyutil.java


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -