Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding buttons to Google Map in android

Tags:

dictionary

I am new to android. I am doing a project as part of my academic. I would like to have few buttons in bottom of the Google Map android like in the waze android application(Sorry that not able to post screen shot). I have tried few things based on the below link How to add buttons at top of map fragment API v2 layout . But did not get desired results.

Can someone please help me with the proper layout. Appreciate your help.

like image 410
Vinoth Sivakumar Avatar asked Sep 03 '25 17:09

Vinoth Sivakumar


1 Answers

Try this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.MapFragment" />

    <Button
        android:id="@+id/setRangeButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/setRange" />
</RelativeLayout>
like image 77
markubik Avatar answered Sep 07 '25 18:09

markubik