1. A concise explanation of the problem you’re experiencing.
I am experiencing crashes on Cesium immediately after pan/tilt/zoom the map after load. I am using create-react-app with cesium (installed using npm). “Cannot read property length of undefined” at getCornerFromEdge.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
componentDidMount() {
var rec = [103.6, 1.22, 104.05, 1.46];
var boundingRectangle = Rectangle.fromDegrees(rec[0], rec[1], rec[2], rec[3]);
I wasn’t able to reproduce this error on Sandcastle, code below. I have tried version 1.61 and I still encounter the error. I did notice that the TerrainFillMesh.js wasn’t present in version 1.54.0.
var rec = [103.6, 1.22, 104.05, 1.46];
var boundingRectangle = Cesium.Rectangle.fromDegrees(rec[0], rec[1], rec[2], rec[3]);
Cesium.Camera.DEFAULT_VIEW_FACTOR = 0;
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = boundingRectangle;
I have found the problem. It appears that to use create-react-app with cesium properly, each time I update to a new version of cesium, I will need to copy the Cesium Source to the public folder (it is not automatic) and add the following to index.js:
import “cesium/Source/Widgets/widgets.css”;
import buildModuleUrl from “cesium/Source/Core/buildModuleUrl”;
buildModuleUrl.setBaseUrl(’./cesium/’);
When I update the Cesium version using npm install cesium@1.61, I will need to copy the Cesium Source folder again and rename it as cesium.