Skip to content

Commit 046eaa5

Browse files
committed
Hook up existing CheckerboardMaterialProperty to CZML.
CheckerboardMaterialProperty was added to the entity API in #2385 but was forgotten for CZML.
1 parent 37cacdf commit 046eaa5

File tree

4 files changed

+4203
-98
lines changed

4 files changed

+4203
-98
lines changed

Apps/Sandcastle/gallery/CZML Polygon.html

+28-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
<script type="text/javascript" src="../Sandcastle-header.js"></script>
1111
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
1212
<script type="text/javascript">
13-
require.config({
14-
baseUrl : '../../../Source',
15-
waitSeconds : 60
16-
});
13+
if(typeof require === 'function') {
14+
require.config({
15+
baseUrl : '../../../Source',
16+
waitSeconds : 120
17+
});
18+
}
1719
</script>
1820
</head>
1921
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
@@ -53,6 +55,28 @@
5355
}
5456
}
5557
}
58+
}, {
59+
"id" : "checkerboardPolygon",
60+
"name" : "Checkerboard polygon on surface",
61+
"polygon" : {
62+
"positions" : {
63+
"cartographicDegrees" : [
64+
-94.0, 37.0, 0,
65+
-95.0, 32.0, 0,
66+
-87.0, 33.0, 0
67+
]
68+
},
69+
"material" : {
70+
"checkerboard" : {
71+
"evenColor" : {
72+
"rgba" : [255, 0, 0, 255]
73+
},
74+
"oddColor" : {
75+
"rgba" : [0, 128, 128, 255]
76+
}
77+
}
78+
}
79+
}
5680
}, {
5781
"id" : "greenPolygon",
5882
"name" : "Green extruded polygon",

Source/DataSources/CzmlDataSource.js

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ define([
4545
'./BillboardGraphics',
4646
'./BoxGraphics',
4747
'./CallbackProperty',
48+
'./CheckerboardMaterialProperty',
4849
'./ColorMaterialProperty',
4950
'./CompositeMaterialProperty',
5051
'./CompositePositionProperty',
@@ -134,6 +135,7 @@ define([
134135
BillboardGraphics,
135136
BoxGraphics,
136137
CallbackProperty,
138+
CheckerboardMaterialProperty,
137139
ColorMaterialProperty,
138140
CompositeMaterialProperty,
139141
CompositePositionProperty,
@@ -1168,6 +1170,14 @@ define([
11681170
processPacketData(Color, existingMaterial, 'gapColor', materialData.gapColor, undefined, undefined, entityCollection);
11691171
processPacketData(Number, existingMaterial, 'dashLength', materialData.dashLength, undefined, sourceUri, entityCollection);
11701172
processPacketData(Number, existingMaterial, 'dashPattern', materialData.dashPattern, undefined, sourceUri, entityCollection);
1173+
} else if (defined(packetData.checkerboard)) {
1174+
if (!(existingMaterial instanceof CheckerboardMaterialProperty)) {
1175+
existingMaterial = new CheckerboardMaterialProperty();
1176+
}
1177+
materialData = packetData.checkerboard;
1178+
processPacketData(Color, existingMaterial, 'evenColor', materialData.evenColor, undefined, sourceUri, entityCollection);
1179+
processPacketData(Color, existingMaterial, 'oddColor', materialData.oddColor, undefined, sourceUri, entityCollection);
1180+
processPacketData(Cartesian2, existingMaterial, 'repeat', materialData.repeat, undefined, sourceUri, entityCollection);
11711181
}
11721182

11731183
if (defined(existingInterval)) {

0 commit comments

Comments
 (0)