B4J Question Google Maps - Geodesic Polyline?

RichardN

Well-Known Member
Licensed User
Longtime User
In B4A you can describe a polyline object and draw a great-circle track instead of a rhumb line...

B4X:
'In B4A.....

Dim pl As Polyline = Gmap.AddPolyline
pl.Geodesic = True
pl.points = List.......

'However in B4J

gmap.AddPolyline(Waypoints,1,fx.Colors.blue)

I can't find any exposure of a Geodesic property in the B4J inplementation of Google Maps.

How is it done?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this sub to set the geodesic property:
B4X:
Sub SetGeodesic(shape As JavaObject)
   shape.GetFieldJO("jsObject").RunMethod("eval", Array($"
       this.setOptions({
          geodesic: true
        });
   "$))
End Sub
B4X:
Dim p As MapPolygon = gmap.AddPolygon(points, 1, fx.Colors.Red, fx.Colors.Transparent, 0)
   SetGeodesic(p)
 
Upvote 0
Top