Android Question Draw a polygon GoogleMap Help!

Discussion in 'Android Questions' started by Acro Soluciones, Jul 9, 2016.

  1. Acro Soluciones

    Acro Soluciones New Member

    Hi, this is my first program with B4A and i think it is great. I followed the google map tutorial and now i have it running in my device without problems. Now i would like to draw a polygon when the user click over the map. How can i do this? Thanks
  2. eurojam

    eurojam Well-Known Member Licensed User

    Welcome in the forum,
    it is something like this:
    Sub DrawPolygon (PointList As List)
    Dim GoogleMapsExtras1 As GoogleMapsExtras
    Dim polygonoptions1 As PolygonOptions
    Dim pg As Polygon = GoogleMapsExtras1.AddPolygon(gmap, polygonoptions1)
    End Sub
    The Pointlist is a List containing objects of the type LatLng. You can collect them for example from the click event on the mapfraqment.
    Sub MapFragment1_LongClick (mPoint As LatLng)
    'put the latLng into a list
    end sub
    inakigarm likes this.
  3. Acro Soluciones

    Acro Soluciones New Member

    Hi, thanks for your answer, i advance a lot in my program, but i still cant draw polygons.
    Dim GoogleMapsExtras1 AsGoogleMapsExtras
    Dim polygonoptions1 AsPolygonOptions

    The program says: Unknown type GoogleMapsExtras.

  4. Erel

    Erel Administrator Staff Member Licensed User

  5. Acro Soluciones

    Acro Soluciones New Member

    Yes, i tried to download the zip but the system does not allowed me to. I think i need to buy a license.
  6. s4agtech

    s4agtech New Member Licensed User

    Hi, i downloaded the library and use the code, i still dont know how can i draw a polygon clicking on map. Thanks
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice