0

I init mapbox traffic plugin in onMapReady but when I want to set visible to true in hamburger menu there is no traffic on map and I call trafficPlugin.setVisibility(true) if I call it from onMapReady it works, but in hamurger menu I have toggle button and if it's off than only when user set it to on traffic should show or if it's on when app is starting than I call trafficPlugin.setVisibility(true) in onMapReady and than it works. How to resolve this?

If I init trafficPlugin when user set toggle to on than I get traffic but it's not below map texts and markers!!! This is also issue!

kacerac
  • 93
  • 9

1 Answers1

0

I init traffic plugin with trafficPlugin = new TrafficPlugin(mapView, mapboxMap, "poi-scalerank3") and now it works great! Also I must always set trafficPlugin to null in onPause if user goes to home screen.

kacerac
  • 93
  • 9