All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.cesium.GpxDataSource.kt Maven / Gradle / Ivy

// Automatically generated - do not modify!

@file:JsModule("cesium")
@file:JsNonModule

package cesium

/**
 * A [DataSource] which processes the GPS Exchange Format (GPX).
 * ```
 * const viewer = new Viewer('cesiumContainer');
 * viewer.dataSources.add(GpxDataSource.load('../../SampleData/track.gpx'));
 * ```
 * @see Online Documentation
 */
external class GpxDataSource {
    /**
     * Gets a human-readable name for this instance.
     * This will be automatically be set to the GPX document name on load.
     * @see Online Documentation
     */
    var name: String

    /**
     * Gets the version of the GPX Schema in use.
     * @see Online Documentation
     */
    var version: String

    /**
     * Gets the creator of the GPX document.
     * @see Online Documentation
     */
    var creator: String

    /**
     * Gets an object containing metadata about the GPX file.
     * @see Online Documentation
     */
    var metadata: Any

    /**
     * Gets the clock settings defined by the loaded GPX. This represents the total
     * availability interval for all time-dynamic data. If the GPX does not contain
     * time-dynamic data, this value is undefined.
     * @see Online Documentation
     */
    var clock: DataSourceClock

    /**
     * Gets the collection of [Entity] instances.
     * @see Online Documentation
     */
    var entities: EntityCollection

    /**
     * Gets a value indicating if the data source is currently loading data.
     * @see Online Documentation
     */
    var isLoading: Boolean

    /**
     * Gets an event that will be raised when the underlying data changes.
     * @see Online Documentation
     */
    var changedEvent: Event

    /**
     * Gets an event that will be raised if an error is encountered during processing.
     * @see Online Documentation
     */
    var errorEvent: Event

    /**
     * Gets an event that will be raised when the data source either starts or stops loading.
     * @see Online Documentation
     */
    var loadingEvent: Event

    /**
     * Gets whether or not this data source should be displayed.
     * @see Online Documentation
     */
    var show: Boolean

    /**
     * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
     * @see Online Documentation
     */
    var clustering: EntityCluster

    /**
     * Updates the data source to the provided time.  This function is optional and
     * is not required to be implemented.  It is provided for data sources which
     * retrieve data based on the current animation time or scene state.
     * If implemented, update will be called by [DataSourceDisplay] once a frame.
     * @param [time] The simulation time.
     * @return True if this data source is ready to be displayed at the provided time, false otherwise.
     * @see Online Documentation
     */
    fun update(time: JulianDate): Boolean

    /**
     * Asynchronously loads the provided GPX data, replacing any existing data.
     * @param [data] A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.
     * @return A promise that will resolve to this instances once the GPX is loaded.
     * @see Online Documentation
     */
    fun load(
        data: dynamic,
        options: LoadOptions? = definedExternally,
    ): kotlin.js.Promise

    /**
     * @property [clampToGround] True if the symbols should be rendered at the same height as the terrain
     * @property [waypointImage] Image to use for waypoint billboards.
     * @property [trackImage] Image to use for track billboards.
     * @property [trackColor] Color to use for track lines.
     * @property [routeColor] Color to use for route lines.
     */
    interface LoadOptions {
        var clampToGround: Boolean?
        var waypointImage: String?
        var trackImage: String?
        var trackColor: String?
        var routeColor: String?
    }

    companion object {
        /**
         * Creates a Promise to a new instance loaded with the provided GPX data.
         * @param [data] A url, parsed GPX document, or Blob containing binary GPX data.
         * @return A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
         * @see Online Documentation
         */
        fun load(
            data: dynamic,
            options: LoadOptions? = definedExternally,
        ): kotlin.js.Promise

        /**
         * @property [clampToGround] True if the symbols should be rendered at the same height as the terrain
         * @property [waypointImage] Image to use for waypoint billboards.
         * @property [trackImage] Image to use for track billboards.
         * @property [trackColor] Color to use for track lines.
         * @property [routeColor] Color to use for route lines.
         */
        interface LoadOptions {
            var clampToGround: Boolean?
            var waypointImage: String?
            var trackImage: String?
            var trackColor: String?
            var routeColor: String?
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy