You can create a custom info window with multiline text.
To do this all you have to do is implement GoogleMap.InfoWindowAdapter
in your Activity
and inflate a custom View
for the info window. Then call GoogleMap#setInfoWindowAdapter
.
public class MapActivity extends AppCompatActivity imeplements OnMapReadyCallback, GoogleMap.InfoWindowAdapter {
private GoogleMap mGoogleMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstaceState);
setContentView(r.layout.activity_map);
SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
fragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.setInfoWindowAdapter(this);
mGoogleMap = googleMap;
}
@Override
public View getInfoWindow(Marker marker) {
return null; // Use default info window background
}
@Override
public View getInfoContents(Marker marker) {
View view = getLayoutInflater().inflate(R.layout.info_window_multiline, null);
TextView titleTextView = (TextView) view.findViewById(R.id.title);
TextView snippetTextView = (TextView) view.findViewById(R.id.snippet);
titleTextView.setText(marker.getTitle());
snippetTextView.setText(marker.getSnippet());
return view;
}
}
Also, the Cordova GoogleMaps Plugin is for applications that use either the Cordova or PhoneGap development frameworks; not for native Android development. The Google Maps Android API is meant for native development; which it seems you are already making use of. Do not confuse the two.