New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gatsby-plugin-cesium

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-cesium

Gatsby plugin to add support for CesiumJS

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-cesium

A Gatsby plugin to add support for CesiumJS.

Install

npm install --save gatsby-plugin-cesium cesium

How to use

Edit gatsby-config.js

module.exports = {
  plugins: ['gatsby-plugin-cesium'],
};

Notable differences from the official webpack integration guide of Cesium

  • All of the Cesium libraries can be imported and used with the following syntax:

    import Cesium from 'cesium';
    import 'cesium/Source/Widgets/widgets.css';
    import React from 'react';
    
    class CesiumContainer extends React.Component {
      componentDidMount() {
        const viewer = new Cesium.Viewer('cesiumContainer');
      }
    
      render() {
        return <div id="cesiumContainer" />;
      }
    }
    
  • Individual modules can be imported using the following syntax:

    import Color from 'cesium/Source/Core/Color';
    
    const color = Color.fromRandom();
    
  • glTF model loading is supported out of the box:

    import CesiumGroundModelURL from '../data/models/CesiumGround.gltf';
    
    const model = viewer.scene.primitives.add(
      Cesium.Model.fromGltf({
        url: CesiumGroundModelURL,
      }),
    );
    

Keywords

gatsby

FAQs

Package last updated on 12 Jul 2018

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