Up to Cesium 1.24, using Browserify (plus the deAMDify transform) on the following code will correctly display the Wyoming polygon from the entity tutorial. From Cesium 1.25 to current (1.37), the same code will not display Wyoming, nor any additional entities added. Oddly, viewer.entities.values reflects the correct number of entities that should be displayed.
Any idea what's causing this? I see no errors, and both the map and imagery layers work fine.
[code]
const Color = require('cesium/Source/Core/Color');
const Cartesian3 = require('cesium/Source/Core/Cartesian3');
const SceneMode = require('cesium/Source/Scene/SceneMode');
const UrlTemplateImageryProvider = require('cesium/Source/Scene/UrlTemplateImageryProvider');
const Viewer = require('cesium/Source/Widgets/Viewer/Viewer');
const buildModuleUrl = require('cesium/Source/Core/buildModuleUrl');
buildModuleUrl.setBaseUrl("/path/to/global/cesium/build/unminified/");
let cesiumViewerOptions = {
baseLayerPicker: false,
imageryProvider: new UrlTemplateImageryProvider({url:"your_provider_here"})
};
const viewer = new Viewer('map', cesiumViewerOptions);
// EXAMPLE geometry: see Cesium's "Visualizing Spatial Data" tutorial
const wyoming = viewer.entities.add({
name: "Wyoming",
polygon: {
hierarchy: Cartesian3.fromDegreesArray([
-109.080842,45.002073,
-105.91517,45.002073,
-104.058488,44.996596,
-104.053011,43.002989,
-104.053011,41.003906,
-105.728954,40.998429,
-107.919731,41.003906,
-109.04798,40.998429,
-111.047063,40.998429,
-111.047063,42.000709,
-111.047063,44.476286,
-111.05254,45.002073]),
height: 0,
material: Color.RED.withAlpha(0.75),
outline: true,
outlineColor: Color.WHITE
}
});
console.log("# entities:", viewer.entities.values.length);
viewer.zoomTo(viewer.entities);