Android Question Create a winding line in GoogleMap

alfaiz678

Active 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

بدون عنوان.png
 
Last edited:

wes58

Active Member
Licensed 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.
 

oparra

Active Member
Licensed 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.
????

googlemap api limits the amount of points in waypoints.



use other service

example:
 

oparra

Active Member
Licensed User
if the idea is useful for you

 

oparra

Active 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

View attachment 94958
you must work with multi-markers and not polylines.

and the marks are a bitmap or a radius circle

search:

 

DonManfred

Expert
Licensed User

oparra

Active 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
 
Top