Force enable GPS of the device on the click of button

I am using leaflet with google maps. I have enabled GPS using the following code:

map.addControl(new L.Control.Gps({style: newStyle}));

But when I navigate to the next page on the click of the button, it must first enable the GPS and get the location and then move to the next page. The next page has a autoform which take details from the user but saves the geo coordinates with it automatically.

How can we achieve: force enable the GPS (if it is not on) when ever user try to navigate to the next page.

Thank you in advance.