iOS Question Gmap: Polyline not drawn

David Meier

Active Member
Licensed User
Longtime User
Hi

I try to draw a polyline on my map. Unfortunately it is not working and I don't see why. Any help is appreciated.

Regards David

B4X:
Sub wegLinie
    gextra.Initialize(gmap)
   
    Dim pl2 As Polyline
    pl2 = gmap.AddPolyline
    Dim  ll4, ll5, ll6, ll7,ll8,ll9,ll10 As LatLng
   
    ll4.Initialize(47.5191458, 7.612324300000001)
    ll5.Initialize(47.5188244, 7.613665999999999)
    ll6.Initialize(47.5195302, 7.614142699999999)
    ll7.Initialize(47.5194594, 7.6184728)
    ll8.Initialize(47.51802000000001, 7.619059999999999)
    ll9.Initialize(47.5133286,7.6207118 )
    ll10.Initialize(47.513098,7.622527 )
    pl2.Points = Array(ll4,ll5,ll6,ll7,ll8,ll9,ll10)
   
    gextra.ZoomToPoints(pl2.Points)
    pl2.Width = 5
    pl2.Color = Colors.Red
   
End Sub
 

David Meier

Active Member
Licensed User
Longtime User
Nothing happens at all and no errors. I am using the same code in a different sub at application start and there it is working. I tried to implement a mechanism where the user can choose a place with given coordinates (with a picker) and the the sub "wegLinie" will draw a polyline from the users current position to the chosen place. Now the sub is filled with dummy data, just for testing.
 
Upvote 0

David Meier

Active Member
Licensed User
Longtime User
Dear Erel
Certainly I can, but please do not spend to much time on it. You will see that the code is chaotic, I am trying out the possibilities of google maps and do not yet know the module very well. But anyway thanks a lot for your apreciated help.

Regards David
 

Attachments

  • GoogleMaps.zip
    3.1 KB · Views: 246
Upvote 0

David Meier

Active Member
Licensed User
Longtime User
I see now! I first tried out the markers and the the polyline. For the markers I wanted to have the previous markers removed whenever I chose a new location from the picker. Hence the gmap.Clear. I guess there is an alternative for this.
Thank you for helping me out here!
 
Upvote 0
Top