Android Question Google Map controls

MikeH

Well-Known Member
Licensed User
Longtime 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
Longtime User
Yes, the standard GoogleMaps library (v1.01)
 
Upvote 0

MikeH

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

MikeH

Well-Known Member
Licensed User
Longtime 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?
 
Upvote 0

MikeH

Well-Known Member
Licensed User
Longtime 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?
 
Upvote 0

warwound

Expert
Licensed User
Longtime 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.
 
Upvote 0

warwound

Expert
Licensed User
Longtime 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.
 
Upvote 0

SCIS

Active Member
Licensed User
Longtime 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.
 
Upvote 0
Top