본문으로 건너뛰기

GetDownloadMostOrderPriority

적용 버전: VIZWide3D 3.0

등록된 fileKey 등록 순서 우선 처리 여부 조회

Returns​

TypeDescription
Booleantrue: 등록 순서 최우선 다운로드 / false: 기본 우선순위

Example​

import VIZCore3DModule from "./VIZCore3D/VIZCore3D.js";

let main = document.createElement('div');
main.className = "VIZWeb_Main";

let view = document.createElement('div');
view.id = "view"
view.className = "VIZCore3D";
main.appendChild(view);

document.body.appendChild(main);
const vizcore = new VIZCore3DModule(view);

let onInitialize = function () {
const fileKey1 = "example1"
const url1 = "./model/toycar/vizw/toycar_wh.vizw";

const fileKey2 = "example2"
const url2 = "./model/sample/model_wh.vizw";

let onload = (e) => {
//해당파일 다운로드 성공
console.log("onload::", e);
};

let onerror = function () {
//해당파일 다운로드 실패
console.log("onerror");
};

//우선적으로 다운로드 해야하는 파일 key 추가
vizcore.Model.AddFileKeyToDownloadMostList(fileKey2);

//등록된 fileKey를 LOD/거리 무관하게 가장 먼저 다운로드
vizcore.Model.SetDownloadMostOrderPriority(true);

//등록 순서 우선 처리 여부 조회
let isOrderPriority = vizcore.Model.GetDownloadMostOrderPriority();
console.log("isOrderPriority::", isOrderPriority); // true

//모델 추가
let models = [];
models.push({ url: url1, key: fileKey1, onload: onload, onerror: onerror });
models.push({ url: url2, key: fileKey2, onload: onload, onerror: onerror });
vizcore.Model.AddFile(models);
};

let vizcoreParam = {
event: {
onInit: onInitialize,
}
};

vizcore.Init(vizcoreParam);