Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@deck.gl/mapbox
Advanced tools
@deck.gl/mapbox is a package that integrates Deck.gl visualizations with Mapbox GL maps. It allows you to create complex and performant visualizations on top of Mapbox maps, leveraging the power of Deck.gl's GPU-accelerated rendering.
Integrate Deck.gl Layers with Mapbox
This feature allows you to add Deck.gl layers to a Mapbox map. The code sample demonstrates how to create a Mapbox map and add a Deck.gl ScatterplotLayer to it.
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
center: [-74.5, 40],
zoom: 9
});
const deckLayer = new deck.MapboxLayer({
id: 'my-deck-layer',
type: deck.ScatterplotLayer,
data: [{position: [-74.5, 40], size: 100}],
getPosition: d => d.position,
getRadius: d => d.size,
getColor: [255, 0, 0]
});
map.on('load', () => {
map.addLayer(deckLayer);
});
Synchronize Deck.gl Layers with Mapbox Camera
This feature ensures that Deck.gl layers stay in sync with the Mapbox camera. The code sample shows how to update the Deck.gl layer's view state whenever the Mapbox map is moved.
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
center: [-74.5, 40],
zoom: 9
});
const deckLayer = new deck.MapboxLayer({
id: 'my-deck-layer',
type: deck.ScatterplotLayer,
data: [{position: [-74.5, 40], size: 100}],
getPosition: d => d.position,
getRadius: d => d.size,
getColor: [255, 0, 0]
});
map.on('load', () => {
map.addLayer(deckLayer);
});
map.on('move', () => {
deckLayer.setProps({
viewState: {
longitude: map.getCenter().lng,
latitude: map.getCenter().lat,
zoom: map.getZoom(),
bearing: map.getBearing(),
pitch: map.getPitch()
}
});
});
Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps. While it does not provide the same level of GPU-accelerated data visualization as Deck.gl, it is highly customizable and can be extended with various plugins.
Leaflet is a popular open-source JavaScript library for mobile-friendly interactive maps. It is lightweight and easy to use but does not offer the same GPU-accelerated rendering capabilities as Deck.gl.
Three.js is a JavaScript library that makes WebGL easier to use. It is not specifically designed for maps but can be used to create 3D visualizations, including maps, with high performance. It requires more manual setup compared to Deck.gl.
Use deck.gl layers as custom mapbox layers, enabling seamless interleaving of mapbox and deck.gl layers.
See deck.gl for documentation.
deck.gl [v9.1.0-beta.3] - Jan 15 2025
FAQs
Use deck.gl layers as custom mapbox-gl-js layers
The npm package @deck.gl/mapbox receives a total of 72,993 weekly downloads. As such, @deck.gl/mapbox popularity was classified as popular.
We found that @deck.gl/mapbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.