/* * @Author: Rindy * @Date: 2021-04-25 16:49:05 * @LastEditors: Rindy * @LastEditTime: 2021-09-15 11:31:00 * @Description: 注释 */ /** * 配置对象 */ const lang_zh = { 'common.about': '约', 'common.meter': '米', 'cad.input': '请输入名称', 'model.enter': '入户门', } const config = { num: null, dom: null, /** * 运行环境 */ env: __ENV__, /** * SDK版本号 */ version: __VERSION__, lang: 'zh', langs: {}, /** * SDK展示模式 */ view: true, /** * 移动端模式 */ mobile: false, /** * 部署方式,本地版为local */ deploy: '', /** * 区域 */ region: '', /** * 服务器地址 */ server: '', //'https://www.4dkankan.com/', /** * 场景资源地址 */ resource: 'https://4dkk.4dage.com/', /** * 显示SDK信息 */ showSDKInfo: true, /** * 是否使用场景控制快捷键 */ useShortcutKeys: false, /** * statistics */ useStatistics: true, /** * 是否需要用户鉴权 */ useAuth: false, /** * 抗锯齿 */ antialias: true, /** * 全景关联设置 */ link: { onAction: null, target: 'self', }, /** * 模型设置 */ model: { /** * 模型名称 */ name: '', }, /** * 场景设置 */ scene: { /** * 图片质量 */ quality: null, /** * 自定义marker图片地址 */ markerURL: null, /** * 自定义marker透明的 */ markerOpacity: null, /** * 自定义当前点位颜色 */ pathEndColor: null, }, vr: { markerHeight: null, }, tag: { showIn: null, }, /** * 获取服务器资源 */ getServerURL(path) { return this.server + path }, /** * 获取场景资源地址 * @param {String} path 资源路径 */ getResourceURL(path) { return this.resource + path }, /** * 获取场景图片地址 * @param {*} path 图片路径 */ getResourceImageURL(path) { return this.getResourceURL(`scene_view_data/${this.num}/images/${path}`) }, /** * 获取场景数据地址 * @param {*} path 数据路径 */ getResourceDataURL(path) { return this.getResourceURL(`scene_view_data/${this.num}/data/${path}`) }, i18n(key) { if (this.langs[this.lang] && this.langs[this.lang][key]) { return this.langs[this.lang][key] } if (!this.langs['zh']) { this.langs['zh'] = lang_zh } return this.langs['zh'][key] || '' }, /** * 是否加载热点 */ isLoadTags: true, } export const merge = function (options) { if (typeof options != 'object') { return } for (let key in config) { if (['env', 'version', 'num'].indexOf(key) != -1) { continue } if (!options.hasOwnProperty(key)) { options[key] = config[key] } } return options } export default config