B4A Library Google Maps RippleEffect

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Aug 12, 2016.

  1. DonManfred

    DonManfred Expert Licensed User

    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

    Code:
    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
    [​IMG]

    New in V2
    MapRadar
    [​IMG]



    ATTENTION: Copy ALL Files to your Additional Libs folder
     

    Attached Files:

    Last edited: Aug 13, 2017 at 11:08 AM
  2. MarcoRome

    MarcoRome Expert Licensed User

    Great Don this is 50+ ;)
     
    DonManfred likes this.
  3. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    I'll be trying this out later Don, cheers...
     
    DonManfred likes this.
  4. Daniel-White

    Daniel-White Active Member Licensed User

    Hi, One simple question, where is came the Dim coord As LatLng .

    LatLng ??????
     
  5. DonManfred

    DonManfred Expert Licensed User

    it is from the googlemaps lib
     
    Daniel-White likes this.
  6. Daniel-White

    Daniel-White Active Member Licensed User

    Yes indeed Plop!! :eek:


    I did a test, I only noticed out of memory when the ripple.NumberOfRipples has the value 4, I can put 3 , 2 ,1 . I don't perhaps something in my code.
    Thanks you DonManfred, it is nice effect, really attractive to focus the user to look into it. :D
     
    DonManfred and Johan Schoeman like this.
  7. Rantor777

    Rantor777 Member Licensed User

    +1, Excellent...
     
    DonManfred likes this.
  8. Almora

    Almora Active Member Licensed User

    If we do not use latlng, we can not use this library.
    +1
     
    Last edited: Dec 30, 2016
  9. IdasI4A

    IdasI4A Member Licensed 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.
     
  10. DonManfred

    DonManfred Expert Licensed User

    I do not understand the question
     
  11. IdasI4A

    IdasI4A Member Licensed User

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

    IdasI4A Member Licensed User

    I think I would need the method
    Code:
    mapRipple.withLatLng (LatLng changedLatlng)
    To update the ripple center
     
  13. DonManfred

    DonManfred Expert Licensed User

    Try it with this version
     

    Attached Files:

  14. IdasI4A

    IdasI4A Member Licensed User

    Thank you very much. I'll try it.
     
  15. Multiverse app

    Multiverse app Member Licensed User

  16. andyr00d

    andyr00d Member Licensed User

    is it possible to also use the 'radar animation'? :)
     
  17. DonManfred

    DonManfred Expert Licensed User

    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! ;-)
     

    Attached Files:

    Erel and Multiverse app like this.
  18. andyr00d

    andyr00d Member Licensed User

    Amazing! :) thank you sir!
     
  19. DonManfred

    DonManfred Expert Licensed User

    I tried it and then i saw that i forgot something in the Radar.... The possibility to start it :D
    Code:
    Sub Globals
        
    Private gmap As GoogleMap
        
    Private MapFragment1 As MapFragment
        
    Private ripple As MapRipple
        
    Private radar As MapRadar
    End Sub
    Code:
    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
     

    Attached Files:

    Daniel-White likes this.
Loading...