Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 589
Sachin K Pissay Avatar asked Aug 24 '15 11:08

Sachin K Pissay


1 Answers

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.

like image 100
bjiang Avatar answered Sep 30 '22 19:09

bjiang