开发者

display widgets on map view

i am new developer in android application.i would like to display Google map in my application.here i would like to displ开发者_运维知识库ay android widgets on map view.can i display android widgets like Buttons,Edit text boxes,Text views et.,

i have design code for get the map in xml as follows

<com.google.android.maps.MapView
             android:id="@+id/mapId" 
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:enabled="true"
             android:clickable="true"
             android:apiKey="XYX_API_CODE_HERE_XYX"
             />

please any body can help me

Thanks in adavnce


There are beautifull demos shipped with the android SDK:

If you'd like to look at sample code, the Google APIs add-on includes an example application called MapsDemo that you can load into your development environment and run. The application is located in the Google APIs directory:

/add-ons/google_apis-API_LEVEL/samples/MapsDemo

Edit:

I missread your question in the first place. What you want to do could best be done with a FrameLayout. I.E.:

<FrameLayout 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">
    <com.google.android.maps.MapView
         android:id="@+id/mapId" 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:enabled="true"
         android:clickable="true"
         android:apiKey="XYX_API_CODE_HERE_XYX"
         />
     <LinearLayout 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" android:orientation="vertical">
           <!-- Your other widgets (buttons, inputBoxes, etc) goes here -->
     </LinearLayout>
</FrameLayout>


Using a FrameLayout, you can add different views in the same space. In your layout xml file, write a FrameLayout with its children as MapView along with buttons, textview, etc.

You can organize the views using layout_gravity as left, right, center, center_horizontal, cener_vertical, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜