Why doesn't ol-cesium import Cesium?
See original GitHub issueI’m trying to use ol-cesium inside a react app, built with create-react-app. When using ol-cesium, i get the Cesium is not defined
error. I see the references to loading Cesium onto the window object, and i’ve tried importing Cesium in the root index.html, with no luck.
I’m trying to load it with:
<script type="text/javascript" src="node_modules/cesium/Build/Cesium/Cesium.js"></script>
I see the network tab load the .js, but its not globally available on the window object. So why doesn’t ol-cesium just import Cesium from
cesium/Cesium’`. It seems like that would be a fairly standard way of loading the library (in addition to having a cesium dependency defined in package.json).
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
OL-Cesium - Example doesn't work - GIS Stack Exchange
You have two options, either download the 1.62 Cesium library cesium and import the Cesium.js as in the example or change this:
Read more >vue.js - Problem with Cesium integration in OpenLayers 5
Ok, I've figured it out. I only needed to add script tag inside an index.html file that points to Cesium build. Example below:...
Read more >Ol-Cesium | OpenLayers - Cesium integration library
There are several ways to integrate OL-Cesium in your application. In all cases OpenLayers and Cesium are peer-dependencies of OL-Cesium, your application need ......
Read more >Adding wms layers issue in ol-cesium - CesiumJS
Hi, I am using ol-cesium in visual studio project. I added WMS, Vector, WMTS layers in openlayers map. I can see Vector and...
Read more >czml import - labels, description - Google Groups
I recently found out about Cesium and love the application so far. ... it doesn't do anything but I'm sure I saw this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, I can’t get
ol-cesium
to run with theol-app
either. I have made the following:–> ol map is running fine, npm stopped.
npm i --save olcs
Then extend the main.js file as follows:npm start
The 2D map can be displayed, but the following message fromOLCesium.js
(from the NPM package itself) appears:Are there any further adjustments to be made there, so that ol-cesium is executable within the
create-ol-app
?I am using
ol-cesium
in version 2.13 and have also run additionalnpm i cesium@1.82
, but this also does not change the error message.@b4l8ter, Your use of ol-cesium is the standard one. Some people use ol-cesium, ol and CesiumJS as “old-fashioned” libs (no ES6 modules at all).
This is historical, “inject_ol_cesium.js” used to load OL, hence its name.