Android Question Google Map controls

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?
 

MikeH

Well-Known Member
Licensed User
Yes, the standard GoogleMaps library (v1.01)
 

MikeH

Well-Known Member
Licensed User
I`ve only noticed it recently and recently I updated the Google Play Services so maybe its that?
 

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:

B4X:
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?
 

MikeH

Well-Known Member
Licensed User
I think so.
Using JavaObject would have resulted in slightly less code but that's neither here nor there.
How would you have done it with javaobject?
 

warwound

Expert
Licensed User
B4X:
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.
 

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.
 

SCIS

Active Member
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.
Can I call an event when a marker is clicked? not the infowindow but the marker.
 
Top