It obviously shouldn’t be asking you while you’re driving, but Google Maps does use the camera to improve your location. It scans things like buildings and landmarks, and gets your position based on where you are in relation to them. It’s surprisingly accurate.