loadCRN

loadCRN(resourceOrUrlOrBuffer)Promise.<CompressedTextureBuffer>|undefined

异步加载并解析给定的URL到CRN文件,或解析CRN文件的原始二进制数据。 返回一个约定(promise),一旦加载完,该约定将解析到一个包含图像缓冲区、宽度、高度和格式的对象,或如果URL未能加载或未能解析数据则丢弃。 使用XMLHttpRequest加载数据,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享(CORS)标头。
Name Type Description
resourceOrUrlOrBuffer Resource | String | ArrayBuffer 二进制数据或ArrayBuffer的URL。
Returns:
将在加载完时解析到请求数据的约定(promise)。 如果request.throttle为true并且请求的优先级不够高,返回undefined。
Throws:
Example:
// 异步加载单个URL
Cesium.loadCRN('some/url').then(function(textureData) {
    var width = textureData.width;
    var height = textureData.height;
    var format = textureData.internalFormat;
    var arrayBufferView = textureData.bufferView;
    // 使用数据创建纹理
}).otherwise(function(error) {
    // 发生错误
});
See: