iOS Question GoogleMapsExtra AddPolygon

chardenal

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

chardenal

Member
Licensed User
Thanks Klaus,

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

Attachments

chardenal

Member
Licensed User
Sorry,

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

Thank you very much.
 
Top