Tuesday, January 22, 2013

Display another layout over GoogleMap

This example demonstrate how to place LinearLayout over GoogleMap, using XML.

Add layout over GoogleMap


<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"
    android:orientation="vertical"
    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"/>
    
    <LinearLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="#A0FFFFFF" >
        <TextView
            android:id="@+id/locinfo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
        <ImageView 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_launcher" />
        
    </LinearLayout>

</RelativeLayout>


The series:
A simple example using Google Maps Android API v2, step by step.

No comments: