Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@loaders.gl/tiles
Advanced tools
@loaders.gl/tiles is a JavaScript library designed to handle various types of tiled data formats. It provides tools for loading, parsing, and visualizing tile-based data, which is commonly used in mapping and 3D visualization applications.
Loading Tile Data
This feature allows you to load tile data from a given URL. The example demonstrates how to load a 3D Tiles tileset using the `Tiles3DLoader`.
const { load } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
async function loadTiles(url) {
const tileset = await load(url, Tiles3DLoader);
console.log(tileset);
}
loadTiles('https://example.com/tileset.json');
Parsing Tile Data
This feature allows you to parse raw tile data into a usable format. The example shows how to parse an ArrayBuffer containing 3D tile data.
const { parse } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
async function parseTileData(arrayBuffer) {
const tile = await parse(arrayBuffer, Tiles3DLoader);
console.log(tile);
}
// Assume arrayBuffer is obtained from a fetch request
parseTileData(arrayBuffer);
Visualizing Tile Data
This feature allows you to visualize tile data using Deck.gl. The example demonstrates how to create a `Tile3DLayer` to visualize a 3D Tiles tileset.
const { load } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
const { Deck } = require('@deck.gl/core');
const { Tile3DLayer } = require('@deck.gl/geo-layers');
async function visualizeTiles(url) {
const tileset = await load(url, Tiles3DLoader);
const deck = new Deck({
initialViewState: {
longitude: -122.4,
latitude: 37.8,
zoom: 14
},
controller: true,
layers: [
new Tile3DLayer({
id: 'tile-3d-layer',
tileset
})
]
});
}
visualizeTiles('https://example.com/tileset.json');
Cesium is a JavaScript library for creating 3D globes and maps. It supports 3D Tiles and provides extensive tools for visualizing and interacting with geospatial data. Compared to @loaders.gl/tiles, Cesium offers a more comprehensive suite of features for 3D visualization but can be more complex to integrate.
Mapbox GL JS is a JavaScript library for interactive, customizable vector maps on the web. It supports vector tiles and raster tiles, making it suitable for 2D and 3D map visualizations. While it is highly optimized for performance and ease of use, it does not natively support 3D Tiles like @loaders.gl/tiles.
Three.js is a popular JavaScript library for 3D graphics on the web. It provides a wide range of features for rendering 3D objects, including support for various tile formats through extensions. However, it requires more manual setup and does not offer built-in support for 3D Tiles, unlike @loaders.gl/tiles.
This module contains the common components for tiles loaders, i.e. 3D tiles.
loaders.gl is a collection of loaders for big data visualizations.
For documentation please visit the website.
FAQs
Common components for different tiles loaders.
The npm package @loaders.gl/tiles receives a total of 108,946 weekly downloads. As such, @loaders.gl/tiles popularity was classified as popular.
We found that @loaders.gl/tiles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.