File tree Expand file tree Collapse file tree
packages/engine/Source/Scene Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,14 +41,36 @@ import BufferPolylineCollection from "./BufferPolylineCollection.js";
4141 * added directly to {@link Scene#primitives}.
4242 *
4343 * @example
44+ * // Load GeoJSON
4445 * const loader = await Cesium.GeoJsonPrimitive.fromUrl("./data.geojson");
4546 * viewer.scene.primitives.add(loader);
4647 *
48+ * @example
49+ * // Access GeoJSON features and properties
4750 * loader.points; // BufferPointCollection | undefined
4851 * loader.polylines; // BufferPolylineCollection | undefined
4952 * loader.polygons; // BufferPolygonCollection | undefined
5053 * loader.ids; // source feature IDs
5154 * loader.properties; // source feature properties
55+ *
56+ * @example
57+ * // Style GeoJSON
58+ * const material = new Cesium.BufferPolylineMaterial({
59+ * color: Cesium.Color.RED,
60+ * width: 4,
61+ * });
62+ *
63+ * const polyline = new Cesium.BufferPolyline();
64+ * const count = primitive.polylines.primitiveCount;
65+ * for (let i = 0; i < count; i++) {
66+ * primitive.polylines.get(i, polyline);
67+ *
68+ * const properties = primitive.getProperties(polyline.featureId);
69+ * if (properties.myCustomProperty === true) {
70+ * polyline.setMaterial(material);
71+ * }
72+ * }
73+ *
5274 * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
5375 */
5476class GeoJsonPrimitive {
You can’t perform that action at this time.
0 commit comments