Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide a MapBox Marker on Android

I want to hide a MapBox Marker on Android, and when I do a zoom I want to show it. Is there a function on MapBox like "setVisible(true or false)" of GoogleMaps Marker ? In GoogleMap you can hide a marker like that :

    Marker marker = map.addMarker(new MarkerOptions()
                .position(new LatLng(49.685, 50.658))  
                .title("Paris"));
    marker.setVisible(false); // hide the marker 

Is there any function on MapBox which do the same ? Thank You.

like image 248
Guillaume Avatar asked Dec 06 '25 05:12

Guillaume


1 Answers

There currently isn't a .setVisible method exposed for use in the Mapbox Android SDK. My suggestion would be to just remove the marker and re-add it when you need to.

like image 144
cammace Avatar answered Dec 07 '25 20:12

cammace



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!