Skip to content

Commit

Permalink
Hook up existing CheckerboardMaterialProperty to CZML.
Browse files Browse the repository at this point in the history
CheckerboardMaterialProperty was added to the entity API in #2385 but
was forgotten for CZML.
  • Loading branch information
shunter committed May 15, 2019
1 parent 37cacdf commit 4f7fc01
Show file tree
Hide file tree
Showing 4 changed files with 4,203 additions and 98 deletions.
32 changes: 28 additions & 4 deletions Apps/Sandcastle/gallery/CZML Polygon.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
Expand Down Expand Up @@ -53,6 +55,28 @@
}
}
}
}, {
"id" : "checkerboardPolygon",
"name" : "Checkerboard polygon on surface",
"polygon" : {
"positions" : {
"cartographicDegrees" : [
-94.0, 37.0, 0,
-95.0, 32.0, 0,
-87.0, 33.0, 0
]
},
"material" : {
"checkerboard" : {
"evenColor" : {
"rgba" : [255, 0, 0, 255]
},
"oddColor" : {
"rgba" : [0, 128, 128, 255]
}
}
}
}
}, {
"id" : "greenPolygon",
"name" : "Green extruded polygon",
Expand Down
10 changes: 10 additions & 0 deletions Source/DataSources/CzmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ define([
'./BillboardGraphics',
'./BoxGraphics',
'./CallbackProperty',
'./CheckerboardMaterialProperty',
'./ColorMaterialProperty',
'./CompositeMaterialProperty',
'./CompositePositionProperty',
Expand Down Expand Up @@ -134,6 +135,7 @@ define([
BillboardGraphics,
BoxGraphics,
CallbackProperty,
CheckerboardMaterialProperty,
ColorMaterialProperty,
CompositeMaterialProperty,
CompositePositionProperty,
Expand Down Expand Up @@ -1168,6 +1170,14 @@ define([
processPacketData(Color, existingMaterial, 'gapColor', materialData.gapColor, undefined, undefined, entityCollection);
processPacketData(Number, existingMaterial, 'dashLength', materialData.dashLength, undefined, sourceUri, entityCollection);
processPacketData(Number, existingMaterial, 'dashPattern', materialData.dashPattern, undefined, sourceUri, entityCollection);
} else if (defined(packetData.checkerboard)) {
if (!(existingMaterial instanceof CheckerboardMaterialProperty)) {
existingMaterial = new CheckerboardMaterialProperty();
}
materialData = packetData.checkerboard;
processPacketData(Color, existingMaterial, 'evenColor', materialData.evenColor, undefined, sourceUri, entityCollection);
processPacketData(Color, existingMaterial, 'oddColor', materialData.oddColor, undefined, sourceUri, entityCollection);
processPacketData(Number, existingMaterial, 'repeat', materialData.repeat, undefined, sourceUri, entityCollection);
}

if (defined(existingInterval)) {
Expand Down
Loading

0 comments on commit 4f7fc01

Please sign in to comment.