Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createMap(container, options) {
try {
// Check for webgl support
if (!Modernizr.webgl) {
throw "WebGL not available in this browser but is required by CesiumJS";
}
let map = new this.cesium.Viewer(container, {
animation: false,
baseLayerPicker: false,
fullscreenButton: false,
geocoder: false,
homeButton: false,
infoBox: false,
sceneModePicker: false,
selectionIndicator: false,
timeline: false,
navigationHelpButton: false,
vrButton: false,
contextOptions: {
alpha: true
if (!Modernizr.fullscreen) {
alerts = alerts.push(
alert.merge({
title: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.title,
body: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.formatString
.replace("{FUNCTIONALITY}", "Fullscreen")
.replace(
"{SYMPTOM}",
"This application will not be able to enter fullscreen mode"
),
severity: 2,
time: new Date()
})
);
}
if (!Modernizr.webgl) {
alerts = alerts.push(
alert.merge({
title: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.title,
body: appStrings.ALERTS.BROWSER_FUNCTIONALITY_MISSING.formatString
.replace("{FUNCTIONALITY}", "WebGL")
.replace(
"{SYMPTOM}",
"This application will not be able to use the 3D map"
),
severity: 3,
time: new Date()
})
);
}
return state.set("alerts", alerts);
}
checkDeviceCapabilites() {
this.hasWebGL = Modernizr.webgl;
this.hasWebGLExtensions = Modernizr.webglextensions;
this.hasSpeechSynthesis = Modernizr.speechsynthesis;
this.hasSpeechRecognition = Modernizr.speechrecognition;
this.hasBatteryAPI = Modernizr.batteryapi;
this.hasLowBattery = Modernizr.lowbattery;
this.hasLowBandwidth = Modernizr.lowbandwidth;
}
[this.props.className]: typeof this.props.className !== "undefined",
[styles.mapControlsContainer]: true
});
return (
<div> this.onMapControlsMouseLeave()}
onMouseEnter={() => this.onMapControlsMouseEnter()}
>
this.setViewMode()}
aria-label={
this.props.in3DMode ? "Switch to 2D map" : "Switch to 3D map"
}
className={styles.singleButton}
>
</div>