Closed emackey closed 8 years ago
If here is actually no difference between Polyline and non-polyline materials, we should eliminate the concept from the writer entirely, which would further simplify the code.
I'll add the caveat that it's been a while since I touched czml-writer code, so I'm not sure what's involved in doing so.
There's a PolylineOutlineMaterial that can't be a generic material. But any generic material can act as a polyline material.
So it looks like there's nothing fancy about generating polyline material code, it's just that the schema files treat it as completely separate from non-polyline materials. In particular, in Polyline.jsonschema, we have this:
"material": {
"$ref": "PolylineMaterial.jsonschema",
"description": "The material to use to draw the polyline."
},
Is there any way to modify this such that it accepts both PolylineMaterial.jsonschema and Material.jsonschema as the value?
For what it's worth, I'm still advocating that we merge this as-is.
Polylines are able to use non-polyline materials, such as stripe, grid, and image.
Stripe
makes dashed lines (be sure to set vertical stripes).Grid
can be used to make lines with "tic marks" on them (this was easy and looks great).Image
offers complete control over the static appearance of a line. Typically the image would be longer horizontally than vertically, as the horizontal direction is the one that stretches over the length of the line (regardless of the line's orientation in the world), and vertical stretches over its width.Here's some sample code that can be added to the end of the
ExampleCesiumLanguageServer
near the end of the CZML writer (insert these lines near line 87, then un-comment one of the three line materials to test it).