カスタムマーカーを作成し、詳細を追加することができます。
あなたはタイトルに情報を渡すのみスニペットとカスタムマーカーでそれを使用することができます
mapView.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
// Use default InfoWindow frame
@Override
public View getInfoWindow(Marker arg0) {
return null;
}
// Defines the contents of the InfoWindow
@Override
public View getInfoContents(Marker arg0) {
// Getting view from the layout file info_window_layout
View v = getActivity().getLayoutInflater().inflate(R.layout.layout_mapinfo, null); // my custom view
// Getting the position from the marker
// LatLng latLng = arg0.getPosition();
// Getting reference to the TextView to set latitude
TextView tvLat = (TextView) v.findViewById(R.id.tv_lat);
// Getting reference to the TextView to set longitude
TextView tvLng = (TextView) v.findViewById(R.id.tv_lng);
// Setting the latitude
tvLat.setText(arg0.getTitle());
// Setting the longitude
AppSession.setIconTypeface(tvLng);
tvLng.setText(Html.fromHtml(arg0.getSnippet()));
// Returning the view containing InfoWindow contents
return v;
}
});
layout_mapinfo.xmlタイトルに値を渡し、スニペット、それをinterpreteする方法する方法
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<TextView
android:id="@+id/tv_lat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:gravity="center_horizontal"
/>
<TextView
android:id="@+id/tv_lng"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:layout_gravity="center"
android:gravity="center"
/>
</LinearLayout>
あなたのカスタムビューであなたの要件に依存しています。
これが役に立ちます。
注:このスニペットは、目的の例です。
実際に入力してください。 –