Skip to content

Conversation

@kikoso
Copy link
Collaborator

@kikoso kikoso commented Nov 3, 2025

This PR fixes an issue on the InfoWindow creation with the KmlParser.

The InfoWindow was being created so far if the Markers had no title or snippet. In this case, the InfoWindow cannot be created.

Fixes #1623

@googlemaps-bot
Copy link
Contributor

googlemaps-bot commented Nov 3, 2025

Code Coverage

Overall Project 40.08% -0.11% 🍏
Files changed 0%

File Coverage
Renderer.java 16.7% -1.65%

@kikoso kikoso marked this pull request as ready for review November 4, 2025 15:09

public View getInfoContents(@NonNull Marker arg0) {
@Override
public View getInfoContents(@NonNull Marker marker) {
Copy link
Contributor

@dkhawk dkhawk Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly cleaner:

        @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);

            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;
        }

@dkhawk dkhawk merged commit d74757c into main Nov 4, 2025
8 checks passed
@dkhawk dkhawk deleted the fix/fixed-infowindow-creation branch November 4, 2025 17:13
googlemaps-bot pushed a commit that referenced this pull request Nov 4, 2025
## [3.19.1](v3.19.0...v3.19.1) (2025-11-04)

### Bug Fixes

* fixed InfoWindow creation in KmlParser ([#1624](#1624)) ([d74757c](d74757c))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 3.19.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

dkhawk pushed a commit that referenced this pull request Nov 12, 2025
## [3.19.1](v3.19.0...v3.19.1) (2025-11-04)

### Bug Fixes

* fixed InfoWindow creation in KmlParser ([#1624](#1624)) ([d74757c](d74757c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashes when clicking on a KML placemark without title

3 participants