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
moduleexports = plugins: 'gatsby-plugin-cesium';
official webpack integration guide of Cesium
Notable differences from the-
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';Component{const viewer = 'cesiumContainer';}{return <div ="cesiumContainer" />;} -
Individual modules can be imported using the following syntax:
;const color = Color; -
glTF model loading is supported out of the box:
;const model = viewersceneprimitives;