The new law is a response to complaints from taxi drivers, and is likely to increase the costs of ride-hailing services.