iOS Question GoogleMapsExtra AddPolygon

Arnaud

Active Member
Licensed User
Longtime User
Hello,

With GoogleMapsExtra, Is it possible to display a polygone "open" and no "close"? or maybe to display a lots of single lines as alternative solution?

Thanks
 

klaus

Expert
Licensed User
Longtime User
Try to add this routine in the class, not tested:
B4X:
'Adds a polyline with the given points
Public Sub AddPolyline (Points As List, StrokeColor As Int, StrokeWidth As Int)
    Dim path As NativeObject = no.RunMethod("createPath:", Array(Points))
    Dim polyline As NativeObject
    polyline = polyline.Initialize("GMSPolyline").RunMethod("polylineWithPath:", Array(path))
    polyline.SetField("map", gm)
    polyline.SetField("strokeWidth", StrokeWidth)
    polyline.SetField("strokeColor", polyline.ColorToUIColor(StrokeColor))
End Sub
 
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Thanks Klaus,

I have tried, but I have an error, I'm probably doing something wrong... (picture in attachment)
 

Attachments

  • polyline.png
    polyline.png
    77.1 KB · Views: 246
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Sorry,

I had not understand, now yes. I confirm your polyline works fine.

Thank you very much.
 
Upvote 0
Top