Android Question Google Map controls

Discussion in 'Android Questions' started by MikeH, Apr 19, 2015.

  1. MikeH

    MikeH Well-Known Member Licensed User

    There are controls that slide in from the bottom right corner when a marker is clicked, like this:

    GmapControls.png

    I already have a control for navigation and a link to Google Maps isn`t needed.

    Is it possible to remove them?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I don't see these icons. Are you using GoogleMaps library?
     
  3. MikeH

    MikeH Well-Known Member Licensed User

    Yes, the standard GoogleMaps library (v1.01)
     
  4. MikeH

    MikeH Well-Known Member Licensed User

    I`ve only noticed it recently and recently I updated the Google Play Services so maybe its that?
     
  5. warwound

    warwound Expert Licensed User

    thedesolatesoul and MikeH like this.
  6. MikeH

    MikeH Well-Known Member Licensed User

    Thank you! I hadn`t used methods like this before so rather than just ask for the answer, this is what I learned:

    Code:
    Dim obj1 As Reflector
    obj1.Target = Gmap.GetUiSettings
    obj1.RunPublicmethod(
    "setMapToolbarEnabled"Array As Object(False), Array As String("java.lang.boolean"))
    Rather than add the JavaObject lib for just this, I used Reflector because I was already using it for something else.

    This piece of code is working but is it the optimum way to do it?
     
    thedesolatesoul likes this.
  7. warwound

    warwound Expert Licensed User

    I think so.
    Using JavaObject would have resulted in slightly less code but that's neither here nor there.
     
  8. MikeH

    MikeH Well-Known Member Licensed User

    How would you have done it with javaobject?
     
  9. warwound

    warwound Expert Licensed User

    Code:
    Dim JavaObject1 As JavaObject
    JavaObject1=GoogleMap1.GetUiSettings
    JavaObject1.RunMethod(
    "setMapToolbarEnabled"Array As Object(False))
    With JavaObject you don't need to pass the 'parameter type' so it's slightly shorter than using Reflection.
     
    Luis Felipe and MikeH like this.
  10. warwound

    warwound Expert Licensed User

    It's worth mentioning that the MapToolbar appears only when:
    • Your map contains Markers.
    • A Marker is clicked.
    • An InfoWindow is then displayed.

    If you handle Marker clicks yourself rather than letting the GoogleMap handle Marker clicks then you'll see the MapToolbar only if your Marker click handler Sub returns False.
     
    DonManfred likes this.
  11. SCIS

    SCIS Active Member Licensed User

    Can I call an event when a marker is clicked? not the infowindow but the marker.
     
  12. DonManfred

    DonManfred Expert Licensed User

Loading...
  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