2017-03-13 3 views
0

Ich möchte einen Schieber haben Karte zu vergrößern, nein, ich habe diese Zoom-Steuerelemente:java android offene Straßenkarte Schieber vergrößern Karte

<ZoomControls 
    android:id="@+id/zoomControls1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_gravity="top" 
    android:src="@drawable/menu" /> 

enter image description here

Aber ich möchte einen Schieber müssen zoomno Diese Tasten

+0

implementiert Was Sie zu tun haben versuchen? Wo sind die Probleme? Jede Art von Anstrengung? – GAlexMES

+0

@GAlexMES Ich habe keine Ahnung, wie ich das tun kann –

+0

@GAlexMES und ich versuche, eine seekBar –

Antwort

0

Wenn Sie Osmdroid-Lib verwenden, müssen Sie es selbst implementieren.

Erstellen Sie ein FrameLayout, das die Karte und eine Suchleiste oben auf der Karte enthält.

<FrameLayout 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"> 
    <!-- the gui --> 
    <RelativeLayout 
     android:id="@+id/parent_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
     <TextView 
      android:id="@+id/cright_osm" 
      android:text="@string/osm_cright_title" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentLeft="true" 
      android:linksClickable="true" 
      android:background="@android:color/white" 
      /> 

     <SeekBar 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/zoomBar" 
      android:layout_above="@id/cright_osm" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentLeft="true" 
      /> 

     <org.osmdroid.views.MapView 
      android:id="@+id/mapview" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@id/zoomBar" 
      /> 
    </RelativeLayout> 
</FrameLayout> 

Here ist ein Code-Fragment, das ein Zoombar

Verwandte Themen