The other day I asked, as fill from a cursor. I got on top of that focus all brands with the maximum zoom. But now I have a problem and fill in the custom view, where there is title, description, and latitude and longitude. It takes me head, I'm trying to look as filling sight, but each does so in a way. I am not able. Here my code
info_windows_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:orientation="vertical"
android:background="#ffffff" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Esto es un titulo"
android:id="@+id/tv_title"
android:textStyle="bold"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="tv_descripcion"
android:id="@+id/tv_descripcion"
android:textSize="16dp" />
<TextView
android:id="@+id/tv_lat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="lat" />
<TextView
android:id="@+id/tv_lng"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="lang" />
</LinearLayout>
CajerosMaps
public class CajerosMaps extends FragmentActivity implements OnMapReadyCallback {
private GoogleMap mMap;
Cursor cursor;
MiCajeroOperacional mb;
LatLngBounds.Builder builder;
CameraUpdate cu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cajeros_maps);
mb = MiCajeroOperacional.getInstance(getApplicationContext());
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
cursor = mb.listar();
mMap = googleMap;
LatLng mark = null;
List<Marker> markersList = new ArrayList<Marker>();
int i = 0;
while (cursor.moveToNext()) {
double lat = cursor.getDouble(cursor.getColumnIndex("lat"));
double lng = cursor.getDouble(cursor.getColumnIndex("lng"));
mark = new LatLng(lat, lng);
Marker markCajero = mMap.addMarker(new MarkerOptions().position(mark).title("Sucursal Nº" + i).snippet(cursor.getString(cursor.getColumnIndex("direccion"))));
// mMap.moveCamera(CameraUpdateFactory.newLatLng(mark), 15);
markersList.add(markCajero);
i++;
}
cursor.close();
builder = new LatLngBounds.Builder();
for (Marker m : markersList) {
builder.include(m.getPosition());
}
int padding = 50;
LatLngBounds bounds = builder.build();
cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);
mMap.moveCamera(cu);
}
}