APIからダウンロードしたマーカーを使用してマップフラグメントを作成しました。SearchView
をフラグメントに追加しました。タイトルごとにマーカーを通すか、または切り取る。入力中にクエリに一致する項目のリストを表示します。アイテムをタップすると他のすべてのマーカーが削除され、タップされたマーカーが拡大表示されます。カスタムマップマーカーで検索して結果をリストに表示する
どうすればいいですか?以下は
fragment_map.xml
<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"
tools:context="com.example.abed.whitelabel.Fragments.CustomersFragment">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.SearchView
android:id="@+id/map_search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
></android.support.v7.widget.SearchView>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>
ありがとうございますが、リンクは私が必要とするものではありません。自分のカスタムクラスの配列を取り込み、その配列を検索したいと思います。また、私はそれを行う方法を理解するのを探しています。 –
@AbedNaseri私は、リンクには、検索ビューのオートコンプリート機能で達成しようとしていることについての情報がかなりあり、わかりやすいと思われます。カスタムクラスでもそれを実行できるはずです。 :) – SripadRaj
もう一度、私は本当に自動提案を必要としないし、私はAPIを介して検索したくない、私はすでにAPIからオブジェクトの配列を移入し、今は配列を検索する必要があります。 @SripadRaj –