Android Question Create a winding line in GoogleMap

AlfaizDev

Well-Known Member
Licensed User
B4X:
gmap.AddMarker(37.772323, -122.214897, "Hello!!!")
                gmap.AddMarker
(21.291982, -157.821856, "Hello2!!!")
                Dim line As Polyline
                Dim Points As List
                Dim point As LatLng
                line=gmap.AddPolyline
                Points.Initialize
             
             
                line.Color=Colors.Blue
                line.Geodesic=True
                line.Visible =True
                line.Width=2
                'line.ZIndex=0
                point.Initialize(37.772323, -122.214897)
                Points.Add(point)
                point.Initialize(21.291982, -157.821856)
                Points.Add(point)
             
                line.Points=Points
                Dim cp As CameraPosition
                cp.Initialize(36, 15, gmap.CameraPosition.Zoom)
                gmap.AnimateCamera(cp)
This code creates a rectangular lab between two tags


I want a code that makes a winding line on the street direction between a sign and my location
As in the picture

 
Last edited:

wes58

Active Member
Licensed User
Longtime User
It is not about the code, but it all depends how many points you have between the start and end. IF you have 2 points you will have a straight line if you have 50 points that follow the road - you will get the polyline (winding line).
If you use google Geocoding API (see this thread https://www.b4x.com/android/forum/t.../b4x-google-geocoding-rest-api.83870/#content) you will get a lot of points between the start and end point - which means you can get the better polyline.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
if the idea is useful for you

 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
you must work with multi-markers and not polylines.

and the marks are a bitmap or a radius circle

search:

 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
You are searching for the route between an address and its location.

and draw a winding line of the route??

example: APP
Delivery or Uber
 
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
You are searching for the route between an address and its location.

and draw a winding line of the route??

example: APP
Delivery or Uber

Yes




Thank you for your interest
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…