Android Question Get GoogleMap MyLocation button

Ohanian

Active Member
Licensed User
Longtime User
Hi,

any chance to use this code is b4a ?

Code: Copy
publicclassMapFragmentextendsSupportMapFragment{@OverridepublicView onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){View mapView =super.onCreateView(inflater, container, savedInstanceState);

// Get the button view View locationButton =((View) mapView.findViewById(1).getParent()).findViewById(2);

// and next place it, for exemple, on bottom right (as Google Maps app)RelativeLayout.LayoutParams rlp =(RelativeLayout.LayoutParams) locationButton.getLayoutParams();// position on right bottom
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP,0);
rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,RelativeLayout.TRUE);
rlp.setMargins(0,0,30,30);}}

Code: Copy
http://stackoverflow.com/questions/14489880/change-position-of-google-maps-apis-my-location-button
 
Hi,

a client asks for it, so it's not an option to use an alternative way.
 
Upvote 0
Did you try to use the setPadding method:
Code: Copy
Dim GoogleMapsExtras1 As GoogleMapsExtras
GoogleMapsExtras1.SetPadding(gmap,0,100dip ,0,0)
this moves the button 100dips from the top

Screenshot_20170112-103425.png
 
Upvote 0

Similar Threads

Replies
2
Views
2K
  • Question Question
Android Question MyLocation
Replies
5
Views
4K
  • Locked
  • Article Article
Android Tutorial Google Maps
Replies
192
Views
209K
Replies
9
Views
7K
Back
Top