@reearth/cesium-mvt-imagery-provider
TypeScript icon, indicating that this package has built-in type declarations

1.5.4 • Public • Published

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

  1. yarn
  2. yarn unlink && yarn build && yarn run link
  3. cd ./example
  4. yarn && yarn dev
  5. 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.

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

Readme

Keywords

none

Package Sidebar

Install

npm i @reearth/cesium-mvt-imagery-provider

Weekly Downloads

22

Version

1.5.4

License

MIT

Unpacked Size

1.11 MB

Total Files

49

Last publish

Collaborators

  • pyshx
  • kawaite
  • eukarya-inc
  • rot1024
  • keiya01
  • darwin-education