iOS Question Google maps draw route

Alberto SN

Member
Licensed User
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:

upload_2016-4-4_23-23-20.png
 

Attachments

  • upload_2016-4-4_23-22-45.png
    upload_2016-4-4_23-22-45.png
    99.3 KB · Views: 168

marcick

Well-Known Member
Licensed User
Longtime User
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&region=it")
Dim HttpRequest1 As HttpRequest
HttpRequest1.InitializeGet(RequestUrl.ToString)
HttpClient1.Execute(HttpRequest1, 1)
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
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
Top