iOS Question gmap add polyline problem

tufanv

Expert
Licensed User
Longtime User
Hello

I am using below code to add polyline to google map ( at locationchanged event )

direction = gmap.AddPolyline

direction.Color=Colors.blue
place.Initialize(location1.Latitude, location1.Longitude)
points.Add(place)
direction.points = points

this code works perfect with b4a but with b4i polyline is not drawen on to google map.

What is the mistake i am doing ?

ty
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

I tried it with this code:
B4X:
Sub gmap_Click (Point As LatLng)
   Dim points As List = pl.Points
   points.Add(Point)
   pl.Points = points
End Sub
Where pl is a global polyline that was previously added and it works. Each time you click on the map a line is drawn.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I am nearly using the sam code with you but you use it on gmap click i use it on loc changed. but cant get the polyline drawen. In the logs i can get the "place" latlong values and can get the direction value which shows

B4X:
Application_Start
Error loading bitmap: Error opening stream: The operation couldn’t be completed. No such file or directory
Error loading bitmap: Error opening stream: The operation couldn’t be completed. No such file or directory
375 x 667 (normalized scale)
en
CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/7C1C36E6-826C-4612-B2AB-DBB987A82354/B4i Example.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/7C1C36E6-826C-4612-B2AB-DBB987A82354/B4i Example.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/7C1C36E6-826C-4612-B2AB-DBB987A82354/B4i Example.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/7C1C36E6-826C-4612-B2AB-DBB987A82354/B4i Example.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
Application_Active
Lat: 40.967010, Lon: 29.073289
<B4IPolyline: <GMSPolyline: 0x1457c450> (null) size 1 width 5.000000 color UIDeviceRGBColorSpace 1 0 0 1>

I dont know if it is a problem but there is a null in front of the direciton log.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
btw I also check the log of the list and list also has no problems but it is not just drawing on to map :/ strange ( with every loc cahnge, a new latlng value added to list )

B4X:
Application_Start
Application_Active
<B4IList: (
    "Lat: 40.967136, Lon: 29.073255"
)>
<B4IList: (
    "Lat: 40.967060, Lon: 29.073233",
    "Lat: 40.967060, Lon: 29.073233"
)>
<B4IList: (
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299"
)>
<B4IList: (
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299"
)>
<B4IList: (
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299",
    "Lat: 40.967026, Lon: 29.073299"
)>
<B4IList: (
    "Lat: 40.967028, Lon: 29.073300",
    "Lat: 40.967028, Lon: 29.073300",
    "Lat: 40.967028, Lon: 29.073300",
    "Lat: 40.967028, Lon: 29.073300",
    "Lat: 40.967028, Lon: 29.073300",
    "Lat: 40.967028, Lon: 29.073300"
)>
<B4IList: (
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188",
    "Lat: 40.966881, Lon: 29.073188"
)>
<B4IList: (
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251",
    "Lat: 40.966877, Lon: 29.073251"
)>
<B4IList: (
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251",
    "Lat: 40.966878, Lon: 29.073251"
)>
<B4IList: (
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890"
)>
<B4IList: (
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890",
    "Lat: 40.967068, Lon: 29.072890"
)>
<B4IList: (
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889"
)>
<B4IList: (
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889",
    "Lat: 40.967020, Lon: 29.072889"
)>
innerClearAll
Application_Inactive
Application_Background
 
Upvote 0
Top