How to enable GPS pragmatically when app is initialize

when i open my ionic app then if GPS is off how to enable GPS pragmatically without going on setting menu

Checking GPS is enabled or not

console.log("GPS location is " + (enabled ? "enabled" : "disabled"));
 }, function(error){
console.error("The following error occurred: "+error);

If success, then use the following plugin to show a confirmation dialog