B4A Library Google Maps RippleEffect

This is a wrap for this Github project.

GoogleMapsRipple
Version: 2.01
  • MapRadar
    Methods:
    • Initialize (EventName As String, map As GoogleMap, latlon As LatLng)
    • IsInitialized As Boolean
    • startRadarAnimation
    • stopRadarAnimation
    • withClockWiseAnticlockwise (sweepAnimationClockWiseAnticlockwise As Boolean)
    • withClockwiseAnticlockwiseDuration (sweepAnimationClockwiseAnticlockwiseDuration As Int)
    • withDistance (distance As Int)
    • withLatLng (latLng As LatLng)
    • withOuterCircleFillColor (fillColor As Int)
    • withOuterCircleStrokeColor (strokeColor As Int)
    • withOuterCircleStrokewidth (strokewidth As Int)
    • withOuterCircleTransparency (transparency As Float)
    • withRadarColors (startColor As Int, tailColor As Int)
    • withRadarSpeed (sweepSpeed As Int)
    • withRadarTransparency (transparency As Float)
    Properties:
    • AnimationRunning As Boolean [read only]
    • ClockwiseAnticlockwiseDuration As Int [read only]
    • RadarAnimationClockWiseAnticlockwise As Boolean [read only]
    • RadarSpeed As Int [read only]
  • MapRipple
    Methods:
    • Initialize (EventName As String, map As GoogleMap, latlon As LatLng)
    • IsInitialized As Boolean
    • startRippleMapAnimation
    • stopRippleMapAnimation
    • withDistance (distance As Double)
    • withDurationBetweenTwoRipples (durationBetweenTwoRipples As Long)
    • withFillColor (fillColor As Int)
    • withLatLng (latLng As LatLng)
    • withNumberOfRipples (numberOfRipples As Int)
    • withRippleDuration (rippleDuration As Long)
    • withStrokeColor (strokeColor As Int)
    • withStrokewidth (strokewidth As Int)
    • withTransparency (transparency As Float)
    Properties:
    • AnimationRunning As Boolean [read only]

Setup your app to be able to use Google Maps

B4X:
    Dim coord As LatLng
    coord.Initialize(editlat.Text, editlon.Text)
 
    ripple.Initialize("",gmap,coord)
    ripple.DurationBetweenTwoRipples = 2500
    ''ripple.FillColor = Colors.Blue
    ripple.Distance = 25
    ripple.StrokeColor = Colors.Red
    ripple.Strokewidth = 10
    ripple.NumberOfRipples = 4
    ripple.RippleDuration = 5000
    ripple.startRippleMapAnimation

Sample2.gif


New in V2
MapRadar
Sample3.gif




ATTENTION: Copy ALL Files to your Additional Libs folder
 

Attachments

  • MapsRipple.zip
    10.8 KB · Views: 806
  • GoogleMapsRippleV2.01.zip
    20.1 KB · Views: 650
Last edited:

Almora

Well-Known Member
Licensed User
Longtime User
If we do not use latlng, we can not use this library.
+1
 
Last edited:

IdasI4A

Active Member
Licensed User
Longtime User
Great, but I have a question:
What if I change positions?
Every time I change from latLng then go that does an Initialize?
Thank you.
 

IdasI4A

Active Member
Licensed User
Longtime User
How do I update the Ripple effect if the coordinate point is changed?
The first time
B4X:
 coord.Initialize (editlat.Text, editlon.Text)
Then I want it to be displayed in (for example)
B4X:
 Coord.Initialize (editlat.Text+10, editlon.Text+10)
And then in
B4X:
 Coord.Initialize (editlat.Text+15, editlon.Text+12)
And so on successively and that the ripple effect moves with the point
 

IdasI4A

Active Member
Licensed User
Longtime User
I think I would need the method
B4X:
mapRipple.withLatLng (LatLng changedLatlng)
To update the ripple center
 

DonManfred

Expert
Licensed User
Longtime User
is it possible to also use the 'radar animation'? :)
Sadfully i lost my Sources some months ago.

But i redownloaded the Github project at 10:50 AM and compiled the AAR with Android Studio
Then i rewrote the Ripple (AND the Radar) into the Library attached.
It is now 11:19 AM (nearly 30 Minutes :D)

PD: I did not tested it! ;-)
 

Attachments

  • GoogleMapsRippleV2.0.zip
    20 KB · Views: 412

DonManfred

Expert
Licensed User
Longtime User
I tried it and then i saw that i forgot something in the Radar.... The possibility to start it :D
B4X:
Sub Globals
    Private gmap As GoogleMap
    Private MapFragment1 As MapFragment
    Private ripple As MapRipple
    Private radar As MapRadar
End Sub
B4X:
Sub MapFragment1_Ready
    Log("MapReady()")
    gmap = MapFragment1.GetMap
    Dim m1 As Marker = gmap.AddMarker(50.833598,6.4411892, "test")
    Dim latlon As LatLng
    latlon.Initialize(50.833598,6.4411892) ' Home of DonManfred
    Dim cp As CameraPosition
    cp.Initialize(latlon.Latitude, latlon.Longitude, 15) ' Use own location LAT LON
    gmap.AnimateCamera(cp)

    ripple.Initialize("",gmap,latlon)
    radar.Initialize("",gmap,latlon)
    ripple.withDistance(500)
    ripple.withDurationBetweenTwoRipples(1500)
    ripple.withFillColor(Colors.Red)
    ripple.withStrokeColor(Colors.Blue)
    ripple.withStrokewidth(10)
    ripple.withTransparency(0.9)
    ripple.withRippleDuration(1000)
    ripple.startRippleMapAnimation

    radar.Initialize("",gmap,latlon)
    radar.withDistance(500)
    radar.withOuterCircleFillColor(Colors.Yellow)
    radar.withOuterCircleStrokeColor(Colors.Magenta)
    radar.withOuterCircleTransparency(1)
    radar.withRadarColors(Colors.Black,Colors.Cyan)
    radar.startRadarAnimation
End Sub
 

Attachments

  • GoogleMapsRippleV2.01.zip
    20.1 KB · Views: 424

ibs06t

Member
Licensed User
Longtime User
Hi

How to change runtime Latitude and Longitude values...

Dim m1 As Marker = gmap.AddMarker(50.833598,6.4411892, "test")
Dim latlon As LatLng
latlon.Initialize(50.833598,6.4411892)

regards
kumar.s
 
Top