大屏引入3d地球,左侧结构编写
This commit is contained in:
35
src/views/gisHome/component/map.vue
Normal file
35
src/views/gisHome/component/map.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div class="ol-map" id="olMap"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// const sdk = ref(null);
|
||||
const createEarth = () => {
|
||||
window.sdk = new YJ.YJEarth('olMap');
|
||||
YJ.Global.setDefaultView(sdk, {
|
||||
destination: { lng: 100, lat: 30, alt: 22099000 },
|
||||
orientation: {
|
||||
heading: 0.0,
|
||||
pitch: -90.0,
|
||||
roll: 0.0
|
||||
}
|
||||
});
|
||||
YJ.Global.CesiumContainer(sdk, {
|
||||
compass: false // 罗盘
|
||||
});
|
||||
new YJ.Tools(sdk).flyHome(0);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await YJ.on();
|
||||
createEarth();
|
||||
console.log(YJ);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ol-map {
|
||||
width: 100%;
|
||||
height: calc(100vh - 123px);
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user