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

@loaders.gl/tiles

Package Overview
Dependencies
Maintainers
8
Versions
269
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/tiles

Common components for different tiles loaders.

  • 4.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
143K
decreased by-18.32%
Maintainers
8
Weekly downloads
 
Created

What is @loaders.gl/tiles?

@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.

What are @loaders.gl/tiles's main functionalities?

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');

Other packages similar to @loaders.gl/tiles

Keywords

FAQs

Package last updated on 26 Nov 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