Alberto SN Member Licensed User Apr 4, 2016 #1 Hi! I have two (or three) points lat-lon, and I need to draw on the map the route from origin to destination. Its possible? Thanks!! This is an example: Attachments upload_2016-4-4_23-22-45.png 99.3 KB · Views: 384
Hi! I have two (or three) points lat-lon, and I need to draw on the map the route from origin to destination. Its possible? Thanks!! This is an example:
Erel B4X founder Staff member Licensed User Longtime User Apr 5, 2016 #2 There is no such feature in the mobile SDK. Upvote 0
marcick Well-Known Member Licensed User Longtime User Apr 7, 2016 #4 you can make an http request, elaborate the JSON responce and create a polyline. B4X: Dim RequestUrl As StringBuilder RequestUrl.Initialize RequestUrl.Append("http://maps.googleapis.com/maps/api/directions/json?origin=" & FromLatitude & "," & From.Longitude & "&destination=" & To.Latitude & "," & To.Longitude & "&sensor=false®ion=it") Dim HttpRequest1 As HttpRequest HttpRequest1.InitializeGet(RequestUrl.ToString) HttpClient1.Execute(HttpRequest1, 1) Upvote 0
you can make an http request, elaborate the JSON responce and create a polyline. B4X: Dim RequestUrl As StringBuilder RequestUrl.Initialize RequestUrl.Append("http://maps.googleapis.com/maps/api/directions/json?origin=" & FromLatitude & "," & From.Longitude & "&destination=" & To.Latitude & "," & To.Longitude & "&sensor=false®ion=it") Dim HttpRequest1 As HttpRequest HttpRequest1.InitializeGet(RequestUrl.ToString) HttpClient1.Execute(HttpRequest1, 1)
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2016 #5 Don't use HttpClient. Use iHttpUtils2. It is easier and also cross platform. Upvote 0
marcick Well-Known Member Licensed User Longtime User Apr 7, 2016 #6 I'll have a look, thanks. Actually it works with HttpClient, do you suggest to modify the code with iHttpUtils2 or just to keep this in mind for the future ? Upvote 0
I'll have a look, thanks. Actually it works with HttpClient, do you suggest to modify the code with iHttpUtils2 or just to keep this in mind for the future ?
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2016 #7 It was a general recommendation. Upvote 0