How to make google map multiple marker's infowindow stays opened android
Asked Answered
S

1

5

I want to make the info Window opened on a marker to stay opened even when another marker is pointed on google map. here's my code.

                 private void drawMarker(LatLng point, String pLoc){
                        // Creating an instance of MarkerOptions
                        MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin_green));

                        // Setting latitude and longitude for the marker
                        markerOptions.position(point);

                        markerOptions.title(pLoc);


                        // Adding the marker to the map
                        m_cGoogleMap.addMarker(markerOptions).showInfoWindow();

                        m_cGoogleMap.setInfoWindowAdapter(new MarkerInfoWindowAdapter(null));
                    }

I'm calling this simple method to add multiple markers. using the showInfoWindow() method just opens the info Window for the current marker, But I want the info Window to stay opened for current and previous markers(Multiple) all time.

Please help me out!!

Thank you.

Sievert answered 24/8, 2015 at 11:20 Comment(0)
M
8

According to official documentation here. It says:

Only one info window is displayed at a time. If a user clicks on another marker, the current info window will be hidden and the new info window will be displayed.

So if you want to display more information for you marker, you may consider to use android-maps-utils library. For more details, please refer to here.

Monastic answered 24/8, 2015 at 16:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.