Usage
JavaScript
requestPosition()
Parameters
This function does not accept any parameters. Is this incorrect?
Source File
Located in /assets/js/modules/location.js on line 177.
No Hooks
This function does not have any filters or actions available. Request one?
JavaScript
function requestPosition(){
if ( google?.maps ){
nebula.loadJS('https://www.google.com/jsapi?key=' + nebula.site.options.nebula_google_browser_api_key, 'google-maps').then(function(){ //May not need key here, but just to be safe.
google.load('maps', '3', {
other_params: 'libraries=placeskey=' + nebula.site.options.nebula_google_browser_api_key,
callback: function(){
nebula.getCurrentPosition();
}
});
});
} else {
getCurrentPosition();
}
}
Override
To override or disable this JavaScript function, simply redeclare it with the exact same function name. Remember: Some functionality is conditionally loaded via dynamic imports, so if your function is not overriding properly, try listening for a DOM event (described below).
JavaScript
function requestPosition(){
//Write your own code here, leave it blank, or return false.
}