Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
// Utilities for Maps SDK for Android (requires Google Play Services)
// You do not need to add a separate dependency for the Maps SDK for Android
// since this library builds in the compatible version of the Maps SDK.
implementation 'com.google.maps.android:android-maps-utils:3.19.0'
implementation 'com.google.maps.android:android-maps-utils:3.19.1'

// Optionally add the Kotlin Extensions (KTX) for full Kotlin language support
// See latest version at https://github.com/googlemaps/android-maps-ktx
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ tasks.register<Delete>("clean") {

allprojects {
group = "com.google.maps.android"
version = "3.19.0"
version = "3.19.1"
}
24 changes: 17 additions & 7 deletions library/src/main/java/com/google/maps/android/data/Renderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1145,23 +1145,33 @@ private void setMarkerInfoWindow(KmlStyle style, Marker marker,

/**
* Creates a new InfoWindowAdapter and sets text if marker snippet or title is set. This allows
* the info window to have custom HTML.
* the info window to have custom HTML. If the marker has no title, the InfoWindow is deactivated.
*/
private void createInfoWindow() {
mMarkers.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {

public View getInfoWindow(@NonNull Marker arg0) {
public View getInfoWindow(@NonNull Marker marker) {
return null;
}

public View getInfoContents(@NonNull Marker arg0) {
@Override
public View getInfoContents(@NonNull Marker marker) {
String title = marker.getTitle();
if (title == null) {
return null;
}

View view = LayoutInflater.from(mContext).inflate(R.layout.amu_info_window, null);
TextView infoWindowText = view.findViewById(R.id.window);
if (arg0.getSnippet() != null) {
infoWindowText.setText(Html.fromHtml(arg0.getTitle() + "<br>" + arg0.getSnippet()));
} else {
infoWindowText.setText(Html.fromHtml(arg0.getTitle()));

StringBuilder infoText = new StringBuilder(title);

String snippet = marker.getSnippet();
if (snippet != null) {
infoText.append("<br>").append(snippet);
}
infoWindowText.setText(Html.fromHtml(infoText.toString()));

return view;
}
});
Expand Down