Hello, i am trying to accomplish a similar effect to what i have done in one of my apps in B4A, I know there is a class Erel wrote for googleMapsExtras but i'm not too sure how to use it yet, below is the code i've written in B4A which accomplishes what i'm trying to do in B4i, i've also attached an image of the animation just so you guys can get a better idea of what it is i'm trying to do.
Here is the code i've used in B4A
Any ideas, i'd really appreciate it any advice or hints to help me accomplish a similar effect.
Thanks,
Walter
Here is the code i've used in B4A
B4X:
Sub MapFragment1_Ready
map = MapFragment1.GetMap
map.MyLocationEnabled = True
Dim googlemapsextra As GoogleMapsExtras
''this is where the marker locations are being added to be used later below to calculate the bounds so that the map can center all the markers added.
Dim LatLngBoundsBuilder1 As LatLngBoundsBuilder
LatLngBoundsBuilder1.Initialize
markers.Initialize
If common.objectlist.Size > 0 Then
For i = 0 To common.objectlist.Size - 1
Dim data As NearByData
Log("objectlist: " & i & " " & common.objectlist.Get(i))
data.Initialize
data = common.objectlist.Get(i)
LogColor("location added: " & data.Lat & " " & data.Lon, Colors.Red)
Dim m1 As Marker = map.AddMarker(data.Lat, data.Lon, data.Bus_Number)
m1.Snippet = data.Title & CRLF & "Bus Stop# " & data.Tag
''adding markers to the LatLngBoundsBuilder
LatLngBoundsBuilder1.Include(m1.Position)
markers.Put(m1, m1)
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, clv.AsView.Width, 75dip)
clv.Add(p, data)
Next
Dim InfoWindowAdapter1 As InfoWindowAdapter
InfoWindowAdapter1.Initialize("InfoWindowAdapter1")
googlemapsextra.SetInfoWindowAdapter(map, InfoWindowAdapter1)
infowindow.Initialize("")
infowindow.SetLayoutAnimated(0,0,0,230dip,120dip)
infowindow.LoadLayout("InfoWindow")
''hackish way to add custom infowindow with custom size
pnlmapfragment.AddView(infowindow, 0, 0, 230dip, 120dip)
infowindow.RemoveView
Dim MarkerBounds As LatLngBounds=LatLngBoundsBuilder1.Build
Dim camupdate As CameraUpdate
Dim camfactory As CameraUpdateFactory
camupdate = camfactory.NewLatLngBounds2(MarkerBounds, 100%x, pnlmapfragment.Height, 128)
googlemapsextra.AnimateCamera(map, camupdate)
End If
End Sub
Any ideas, i'd really appreciate it any advice or hints to help me accomplish a similar effect.
Thanks,
Walter