createOsmBuildingsAsync

Creates a Cesium3DTileset instance for the Cesium OSM Buildings tileset.
Examples:
// Create Cesium OSM Buildings with default styling
const viewer = new Cesium.Viewer("cesiumContainer");
try {
  const tileset = await Cesium.createOsmBuildingsAsync();
  viewer.scene.primitives.add(tileset));
} catch (error) {
  console.log(`Error creating tileset: ${error}`);
}
// Create Cesium OSM Buildings with a custom style highlighting
// schools and hospitals.
const viewer = new Cesium.Viewer("cesiumContainer");
try {
  const tileset = await Cesium.createOsmBuildingsAsync({
    style: new Cesium.Cesium3DTileStyle({
      color: {
        conditions: [
          ["${feature['building']} === 'hospital'", "color('#0000FF')"],
          ["${feature['building']} === 'school'", "color('#00FF00')"],
          [true, "color('#ffffff')"]
        ]
      }
    })
  });
  viewer.scene.primitives.add(tileset));
} catch (error) {
  console.log(`Error creating tileset: ${error}`);
}
See:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.