Web SDK geolocation consent form

Follow

When page wants to get access to client's geolocation with geolocation consent form the reason behind collecting geolocation from client can be better justified.

Geolocation consent form has three buttons yes, no and close. If clients clicks the no button no geolocation is asked same logic also on close button; if client clicks the yes button native HTML5 geolocation notification will appear.

The geolocation consent form can be used by adding the below Web SDK script to page which collects geolocation:

    var init = beemray.Initialize.instance();
var consentForm = beemray.GeoLocationConsent.instance().create(); consentForm.setMessage("Would you like to have more accurate weather data"); consnetForm.setTitle("Geolocation consent"); consentForm.setNoButtonValue("NO"); consentForm.setYesButtonValue("YES");
init.setLocationConsentForm(consentForm); init.register();

Using the default Beemray consent from:

    var init = beemray.Initialize.instance();
var consentForm = beemray.GeoLocationConsent.instance().create(); consentForm.useDefault();
init.setLocationConsentForm(consentForm); init.register();

 Default consent form.

Overwriting the geolocation consent form styles:

You can overwrite default styles as you do normally in your workflow or by using overwrite class.

Example

Default style for dialog wrapper:

#location-permission-wrapper {

 position: absolute;

 ...

}

Overwrite default:

#location-permission-wrapper.overwrite {

 position: fixed;

 ...    

}

Have more questions? Submit a request

Comments