You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* QueryParameters must be an object whose keys are parameter names and whose
219
+
* values are a primitive (string, number, boolean) or an array thereof.
220
+
* */
221
+
222
+
/**
223
+
* @typedef {Object} Resource.ConstructorOptions
224
+
*
225
+
* Initialization options for the Resource constructor
226
+
*
227
+
* @property {String} url The url of the resource.
228
+
* @property {Resource.QueryParameters} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.
229
+
* @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
230
+
* @property {Object} [headers={}] Additional HTTP headers that will be sent.
231
+
* @property {Proxy} [proxy] A proxy to be used when loading the resource.
232
+
* @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
233
+
* @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.
234
+
* @property {Request} [request] A Request object that will be used. Intended for internal use only.
235
+
*/
236
+
215
237
/**
216
238
* A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.
217
239
*
218
240
* @alias Resource
219
241
* @constructor
220
242
*
221
-
* @param {String|Object} options A url or an object with the following properties
222
-
* @param {String} options.url The url of the resource.
223
-
* @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
224
-
* @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
225
-
* @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
226
-
* @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
227
-
* @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
228
-
* @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
229
-
* @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
243
+
* @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options
230
244
*
231
245
* @example
232
246
* function refreshTokenRetryCallback(resource, error) {
@@ -574,7 +588,7 @@ Resource.prototype.getUrlComponent = function (query, proxy) {
574
588
* Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
575
589
* as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.
576
590
*
577
-
* @param {Object} params The query parameters
591
+
* @param {Resource.QueryParameters} params The query parameters
578
592
* @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined.
* Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
551
551
* @memberof EntityCluster.prototype
552
-
* @type {Event}
552
+
* @type {Event<EntityCluster.newClusterCallback>}
553
553
*/
554
554
clusterEvent: {
555
555
get: function(){
@@ -963,7 +963,8 @@ EntityCluster.prototype.destroy = function () {
963
963
* @callback EntityCluster.newClusterCallback
964
964
*
965
965
* @param {Entity[]} clusteredEntities An array of the entities contained in the cluster.
966
-
* @param {Object} cluster An object containing billboard, label, and point properties. The values are the same as
Copy file name to clipboardexpand all lines: Source/DataSources/exportKml.js
+51-25
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,33 @@ IdManager.prototype.get = function (id) {
221
221
222
222
returnid.toString()+"-"+++ids[id];
223
223
};
224
+
/**
225
+
* @variation 2 KML return
226
+
* @param {Object} options An object with the following properties:
227
+
* @param {EntityCollection} options.entities The EntityCollection to export as KML.
228
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file.
229
+
* @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection.
230
+
* @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML.
231
+
* @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability.
232
+
* @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML.
233
+
* @param {false} [options.kmz=false] If false or unset, returns the KML file and referenced resources individually
234
+
*
235
+
* @returns {Promise<exportKmlResultKml>} A promise that resolved to an object containing the KML string and a dictionary of external file Blobs
236
+
*
237
+
* @example
238
+
* Cesium.exportKml({
239
+
* entities: entityCollection
240
+
* })
241
+
* .then(function(result) {
242
+
* // The XML string is in result.kml
243
+
*
244
+
* var externalFiles = result.externalFiles
245
+
* for(var file in externalFiles) {
246
+
* // file is the name of the file used in the KML document as the href
247
+
* // externalFiles[file] is a Blob with the contents of the file
248
+
* }
249
+
* });
250
+
*/
224
251
225
252
/**
226
253
* @typedef exportKmlResultKml
@@ -236,44 +263,43 @@ IdManager.prototype.get = function (id) {
236
263
*/
237
264
238
265
/**
239
-
* Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
240
-
* will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
241
-
* example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
242
-
* options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
243
-
* that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
244
-
* the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
245
-
* as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
246
-
* color is used. Canvas objects are exported as PNG images.
266
+
* Exports an EntityCollection as a KML document or KMZ archive.
267
+
*
268
+
* Only Point, Billboard, Model, Path, Polygon, Polyline geometries will be exported.
269
+
* Note that there is not a 1 to 1 mapping of Entity properties to KML Feature
270
+
* properties. For example, entity properties that are time dynamic but cannot
271
+
* be dynamic in KML are exported with their values at `options.time` or the
272
+
* beginning of the EntityCollection's time interval if not specified. For
273
+
* time-dynamic properties that are supported in KML, we use the samples if it
274
+
* is a {@link SampledProperty}, otherwise we sample the value using the
275
+
* `options.sampleDuration`. Point, Billboard, Model and Path geometries with
276
+
* time-dynamic positions will be exported as gx:Track Features.
247
277
*
248
-
* @function exportKml
278
+
* Not all Materials are representable in KML, so for more advanced Materials
279
+
* just the primary color is used. Canvas objects are exported as PNG images.
249
280
*
281
+
* @variation 1 KMZ return
250
282
* @param {Object} options An object with the following properties:
251
283
* @param {EntityCollection} options.entities The EntityCollection to export as KML.
252
284
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file.
253
285
* @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection.
254
286
* @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML.
255
287
* @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability.
256
288
* @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML.
257
-
* @param {Boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file.
289
+
* @param {true} options.kmz If true, KML and external files will be compressed into a single KMZ file.
290
+
*
291
+
* @returns {Promise<exportKmlResultKmz>} A promise that resolves to a KMZ file as a Blob.
258
292
*
259
-
* @returns {Promise<exportKmlResultKml|exportKmlResultKmz>} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true.
0 commit comments