I have used my iPhone and google maps for some years as a satnav with no problems. I bought a plug that fits into the cigarette lighter and provides the usual usb connection for the phone. It looks as if apple sells a suitable plug in their shops. If you have a holder to fit the phone onto the window/dashboard this is perfectly safe and legal.
This quote is from their website:-
Subject to following Apple's guidance, car chargers are not harmful to iPhone. When using electronic accessories with your iPhone, Apple advises ensuring that they are either genuine Apple products or that they have been certified as Made for iPhone under the MFi program.