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 59c99af
Show file tree
Hide file tree
Showing 5 changed files with 4,204 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log
##### Additions :tada:
* Added support for new `BingMapsStyle` values `ROAD_ON_DEMAND` and `AERIAL_WITH_LABELS_ON_DEMAND`. The older versions of these, `ROAD` and `AERIAL_WITH_LABELS`, have been deprecated by Bing. [#7808](https://github.com/AnalyticalGraphicsInc/cesium/pull/7808)
* Added syntax to delete data from existing properties via CZML. [#7818](https://github.com/AnalyticalGraphicsInc/cesium/pull/7818)
* Added `checkerboard` material to CZML. [#7845](https://github.com/AnalyticalGraphicsInc/cesium/pull/7845)
* `BingMapsImageryProvider` now uses `DiscardEmptyTileImagePolicy` by default to detect missing tiles as zero-length responses instead of inspecting pixel values. [#7810](https://github.com/AnalyticalGraphicsInc/cesium/pull/7810)

##### Fixes :wrench:
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(Cartesian2, existingMaterial, 'repeat', materialData.repeat, undefined, sourceUri, entityCollection);
}

if (defined(existingInterval)) {
Expand Down
Loading

0 comments on commit 59c99af

Please sign in to comment.