Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/mapbox-gl-supported

Package Overview
Dependencies
Maintainers
28
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/mapbox-gl-supported

A library to determine if a browser supports Mapbox GL JS

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
883K
decreased by-16.25%
Maintainers
28
Weekly downloads
 
Created

What is @mapbox/mapbox-gl-supported?

@mapbox/mapbox-gl-supported is a utility package that helps developers determine if the current browser environment supports Mapbox GL JS. This is useful for conditionally loading Mapbox GL JS maps or providing fallback content for unsupported browsers.

What are @mapbox/mapbox-gl-supported's main functionalities?

Check if Mapbox GL JS is supported

This feature allows you to check if the current browser environment supports Mapbox GL JS. If supported, you can proceed to load Mapbox GL JS maps; otherwise, you can provide alternative content.

const mapboxglSupported = require('@mapbox/mapbox-gl-supported');

if (mapboxglSupported()) {
  console.log('Mapbox GL JS is supported');
} else {
  console.log('Mapbox GL JS is not supported');
}

Check if Mapbox GL JS is supported with specific options

This feature allows you to check if the current browser environment supports Mapbox GL JS with specific options, such as failing if there is a major performance caveat. This can help ensure a better user experience by avoiding loading maps in suboptimal conditions.

const mapboxglSupported = require('@mapbox/mapbox-gl-supported');

const options = { failIfMajorPerformanceCaveat: true };
if (mapboxglSupported(options)) {
  console.log('Mapbox GL JS is supported with the given options');
} else {
  console.log('Mapbox GL JS is not supported with the given options');
}

Other packages similar to @mapbox/mapbox-gl-supported

FAQs

Package last updated on 19 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc