Is there a way to prevent GPS from sleeping when I lock the phone even though google maps app is running?
The only way I know how to do this is through Tasker. You can use a tasker profile to set the gps to stay on when the screen turns off. You can also use a profile to keep gps running while the app is open. The only draw back is the price tag (I'm pretty sure it's $5.95 on the market), but you will use this app for more than just keeping gps on, I can promise you that.
If you do end up going this route and need help setting up the profile let me know.