Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook up existing CheckerboardMaterialProperty to CZML. #7845

Merged
merged 1 commit into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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