Add Controls on mapview

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Add Controls on mapview

Postby sam » Sun Jul 20, 2008 1:09 pm

Hi,

How can i add a set of controls on a mapview, just like http://commandro.net/images/common.jpg found on Commandro project.

Thanks,
Sam
sam
Freshman
Freshman
 
Posts: 5
Joined: Sun Jul 20, 2008 12:57 pm
Location: Pakistan

Top

Postby plusminus » Sun Jul 20, 2008 1:41 pm

Hello sam,

this post should help you further: http://www.anddev.org/viewtopic.php?p=4590#4590

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby sam » Tue Jul 22, 2008 4:10 pm

Hi plusminus,

From the above link:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.     android:layout_width="fill_parent"
  6.  
  7.     android:layout_height="fill_parent">
  8.  
  9.      <view class="com.google.android.maps.MapView"
  10.  
  11.          android:id="@+id/map_map"
  12.  
  13.          android:layout_width="fill_parent"
  14.  
  15.          android:layout_height="fill_parent"/>
  16.  
  17.      <ImageView
  18.  
  19.          android:id="@+id/iv_map_zoomin"
  20.  
  21.          android:layout_alignParentTop="true"
  22.  
  23.          android:layout_alignParentRight="true"
  24.  
  25.          android:layout_width="wrap_content"
  26.  
  27.          android:layout_height="wrap_content"
  28.  
  29.          android:src="@drawable/plus_32"/>
  30.  
  31.      <ImageView
  32.  
  33.          android:id="@+id/iv_map_zoomout"
  34.  
  35.          android:layout_alignParentTop="true"
  36.  
  37.          android:layout_alignParentLeft="true"
  38.  
  39.          android:layout_width="wrap_content"
  40.  
  41.          android:layout_height="wrap_content"
  42.  
  43.          android:src="@drawable/minus_32"/>
  44.  
  45. </RelativeLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


They only add zoomin and zoomout buttons on the top. How do you add bottom components which tell total kms and direction etc?

Have you extended view class? And how do you add a label, text box and image (as in lower left corner on ur screenshot) on a map?

Thanks,
Sami
sam
Freshman
Freshman
 
Posts: 5
Joined: Sun Jul 20, 2008 12:57 pm
Location: Pakistan

Postby plusminus » Thu Jul 24, 2008 5:04 pm

That is done with overlays.
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby sam » Fri Jul 25, 2008 10:07 am

Thanks,

Is there a way to specify layout of an overlay through XML?
sam
Freshman
Freshman
 
Posts: 5
Joined: Sun Jul 20, 2008 12:57 pm
Location: Pakistan

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests