From 653bf6d222e4ba43db29f439fcb2b4b12b0c69b8 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Tue, 3 Sep 2013 15:59:34 -0400 Subject: [PATCH] Expose CZML helper functions. #1080 accidentally removed some helper functions needed for custom CZML processing. I expect these function to go away in the near future, but they are definitely needed for now in apps that use custom CZML. CC @emackey --- Source/DynamicScene/CzmlDataSource.js | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Source/DynamicScene/CzmlDataSource.js b/Source/DynamicScene/CzmlDataSource.js index 070f2bda92f9..7065464d33fd 100644 --- a/Source/DynamicScene/CzmlDataSource.js +++ b/Source/DynamicScene/CzmlDataSource.js @@ -1304,6 +1304,49 @@ define([ }); }; + /** + * A helper function used by custom CZML updater functions + * which creates or updates a {@link Property} from a CZML packet. + * @function + * + * @param {Function} type The constructor function for the property being processed. + * @param {Object} object The object on which the property will be added or updated. + * @param {String} propertyName The name of the property on the object. + * @param {Object} packetData The CZML packet being processed.y + * @param {TimeInterval} [interval] A constraining interval for which the data is valid. + * @param {String} [sourceUri] The originating uri of the data being processed. + * @returns {Boolean} True if a new property was created, false otherwise. + */ + CzmlDataSource.processPacketData = processPacketData; + + /** + * A helper function used by custom CZML updater functions + * which creates or updates a {@link PositionProperty} from a CZML packet. + * @function + * + * @param {Object} object The object on which the property will be added or updated. + * @param {String} propertyName The name of the property on the object. + * @param {Object} packetData The CZML packet being processed.y + * @param {TimeInterval} [interval] A constraining interval for which the data is valid. + * @param {String} [sourceUri] The originating uri of the data being processed. + * @returns {Boolean} True if a new property was created, false otherwise. + */ + CzmlDataSource.processPositionPacketData = processPositionPacketData; + + /** + * A helper function used by custom CZML updater functions + * which creates or updates a {@link MaterialProperty} from a CZML packet. + * @function + * + * @param {Object} object The object on which the property will be added or updated. + * @param {String} propertyName The name of the property on the object. + * @param {Object} packetData The CZML packet being processed.y + * @param {TimeInterval} [interval] A constraining interval for which the data is valid. + * @param {String} [sourceUri] The originating uri of the data being processed. + * @returns {Boolean} True if a new property was created, false otherwise. + */ + CzmlDataSource.processMaterialPacketData = processMaterialPacketData; + CzmlDataSource._processCzml = function(czml, dynamicObjectCollection, sourceUri, updaterFunctions) { var updatedObjects = []; var updatedObjectsHash = {};