Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - remove traffic from Google maps in SupportMapFragment

I load my map in: public class MapFragment extends SupportMapFragment {...

I can't figure out how to turn off traffic layer. I tried getMap().setTrafficEnabled(false); but it doesn't seem to work.

Could someone help me understand how does it work? Thank you.

like image 416
chabislav Avatar asked Mar 10 '26 09:03

chabislav


1 Answers

Thank you @Aaron He! Deprecated getMap() was the issue. After refactoring my code to use getMapAsync() it works! Thanks again!

like image 87
chabislav Avatar answered Mar 11 '26 23:03

chabislav