Mapbox Integration
The Mapbox integration in Consent Manager doesn't directly integrate scripts from Mapbox. Instead, it focuses on managing user consent for utilizing Mapbox maps and services within your application, ensuring GDPR-compliant usage.
Title | Mapbox |
ID | mapbox |
Icon | |
Brand color | #000000 |
Contrast color | #fff |
Description | We use Mapbox to provide you a dynamic, performant and feature-rich experience with maps. |
Privacy policy | https://www.mapbox.com/legal/privacy |
WrapperComponent | ⛔️ |
Enabled by default | ⛔️ |
Managing Consent for Mapbox
To control the loading of Mapbox map services based on user consent, you can utilize the useDecision
hook from Consent Manager Core or the PrivacyShield
component.
Example: Conditional Loading of Mapbox Services with the Privacy Shield Component
Here's an example of how you can conditionally load a Mapbox map component based on user consent:
import React from 'react';
import { PrivacyShield } from '@consent-manager/core';
import MapboxMapComponent from './MapboxMapComponent';
function MapWithConsent() {
return (
<PrivacyShield id="mapbox">
<MapboxMapComponent />
</PrivacyShield>
);
}
export default MapWithConsent;