2017-11-30 3 views
1

Ich möchte ein Tag wie in der Uber App neben meinem Marker anzeigen. Wie mache ich ein solches Tag in Google Map?Wie man ein Marker-Tag wie Uber macht?

Ich versuche bereits, einen Titel und ein Snippet hinzuzufügen. Aber es ist nicht das, wonach ich mich sehne.

mMap.addMarker(new MarkerOptions() 
         .position(MELBOURNE) 
         .title("6 min away") 
         .snippet("Pick up point ") 
         .icon(BitmapDescriptorFactory.fromResource(R.drawable.pickup_2x))); 

enter image description here

das, was ich mit @Nirmal Antwort bekommen ist. Es ist immer noch nicht, was ich will genau This is what i got with @Nirmal answer. Its still not what I want exactly

Antwort

3

info_window_layout.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@android:color/white" 
    android:orientation="horizontal"> 

    <wm.com.taxiapp.view.CustomTextView 
     android:id="@+id/tv_distance" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="2.5" 
     android:background="@android:color/black" 
     android:gravity="center" 
     android:paddingLeft="@dimen/space_10" 
     android:paddingRight="@dimen/space_10" 
     android:text="2\nMIN" 
     android:textColor="@android:color/white" 
     android:textSize="@dimen/font_8" /> 

    <ImageView 
     android:id="@+id/iv_scheduled_ride" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="2.5" 
     android:background="@android:color/black" 
     android:gravity="center" 
     android:paddingLeft="@dimen/space_10" 
     android:paddingRight="@dimen/space_10" 
     android:src="@drawable/time" 
     android:visibility="gone" /> 

    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="6" 
     android:background="@android:color/white" 
     android:orientation="vertical"> 

     <wm.com.taxiapp.view.CustomTextView 
      android:id="@+id/tv_lat" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:ellipsize="end" 
      android:maxLines="1" 
      android:paddingLeft="@dimen/space_5" 
      android:paddingRight="@dimen/space_5" 
      android:paddingTop="@dimen/space_3dp" 
      android:scrollbars="none" 
      android:text=" " 
      android:textColor="@color/hintColor" 
      android:textSize="@dimen/font_12" /> 

     <wm.com.taxiapp.view.CustomTextView 
      android:id="@+id/tv_lng" 
      android:layout_width="@dimen/space_100" 
      android:layout_height="match_parent" 
      android:ellipsize="end" 
      android:maxLines="1" 
      android:paddingBottom="@dimen/space_3dp" 
      android:paddingLeft="@dimen/space_5" 
      android:scrollbars="none" 
      android:text="" 
      android:textColor="@color/hintColor" 
      android:textSize="@dimen/font_12" /> 

    </LinearLayout> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:src="@drawable/arrow_right" /> 

</LinearLayout> 

aufpumpen diese Layout-Datei in Info-Fenster mMap.setInfoWindowAdapter

+0

willkommen, glücklich Codierung !! –

+0

das hilft nicht. Trotzdem ist es nicht was ich will. Ich habe meinen Post mit Bild bearbeitet, das ich mit deiner Antwort bekommen habe. –

+1

müssen Sie Infowindow auf Karte implementieren und dieses Layout in Ihr Infofenster aufblasen. –