🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@reearth/cesium-mvt-imagery-provider

Package Overview
Dependencies
Maintainers
7
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reearth/cesium-mvt-imagery-provider

Custom ImageryProvider for Mapbox Vector Tiles (extended for Re:Earth)

latest
Source
npmnpm
Version
1.6.0
Version published
Maintainers
7
Created
Source

cesium-mvt-imagery-provider

Usage

const imageryProvider = new MVTImageryProvider({
  urlTemplate: "http://localhost:8080/sample_mvt/{z}/{x}/{y}.mvt",
  layerName: "layerName", // or "layerName1,layerName2,layerName3"
  worker: true, // by default false
  credit: "cesium.js",
});

const layers = viewer.scene.imageryLayers;
const currentLayer = layers.addImageryProvider(imageryProvider);
currentLayer.alpha = 0.5;

// Call `layers.remove(currentLayer);` when it is unnecessary.

See example directory for more details.

Development

  • yarn
  • yarn unlink && yarn build && yarn run link
  • cd ./example
  • yarn && yarn dev
  • Then example cesium application is started

If you run example, you need to set sample MVT data to ./example/public. And you should change layerName option for MVTImageryProvider in ./example/src/Imagery.tsx.

If you want to run this library on your vite project, you can do it like the following.

  • yarn build
  • cp ./dist ~/your_project && rm -rf node_modules/.vite
  • Restart your project server

FAQs

Package last updated on 10 Jan 2025

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