I'm making a "navigation" like app, and I want to display a lot of POI like food_and_drink
and others (Hotels, Historical) and when the user starts the "navigation" I would like to hide some of this POI to avoid an extra "load" and "noise" in the map, I can't find the way to this with the default POI, I'm using mapbox studio and I can show/hide some POI but I want them to be visible and then later "hide" and when the navigation is over "show" them again, is possible this?
I tried loading the style
retrieveMap()?.getStyle {
it.getLayer("food_and_drink")?.let { layer ->
if (VISIBLE == layer.visibility.value) {
layer.setProperties(PropertyFactory.visibility(NONE))
}else{
layer.setProperties(PropertyFactory.visibility(VISIBLE))
}
}
}
But that does not work. Thanks a lot