I am working on mapbox android. I need the infowindow to be shown on top of all markers when the activity is loaded, without having to click on the markers to see each info window.How do I acheive this functionality in mapbox?
Here is the code:-
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(final MapboxMap map) {
mapboxMap = map;
mapboxMap.addMarker(new MarkerOptions()
.title("hello")
.snippet("I am here")
.position(new LatLng(33.948,-118.08)));
mapboxMap.setInfoWindowAdapter(new MapboxMap.InfoWindowAdapter() {
@Nullable
@Override
public View getInfoWindow(@NonNull Marker marker) {
//What do I give here so that marker click is not at all needed to inflate the Infowindow.
return null;
}
});
)
});
Use this code to open infowindow bydefault
Marker marker = myMap.addMarker(new MarkerOptions()
.position(latLng)
.title("Title")
.snippet("Snippet")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.marker)));
marker.showInfoWindow();
but this working only for one marker,fOR multiple marker it opens infowindow for last marker. Source From this Link