I'm trying to add multiple markers using Mapbox Android SDK and using symbolManager as recommended here.
I just create this function which is responsible to create one marker for each car object. I don't get any error but nothing is displayed on the map.
private fun displayCarsLayer(cars: MutableList<Car>) {
mapView.getMapAsync(OnMapReadyCallback { mapboxMap ->
for (car in cars) {
val carLat = car.lat
val carLng = car.lng
// Add the marker to the map
symbolManager.create(
SymbolOptions()
.withLatLng(LatLng(carLat, carLng))
);
}
})
}