2025-04-29 18:09:13 +08:00
|
|
|
<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
|
|
|
|
}
|
|
|
|
});
|
2025-05-13 18:29:12 +08:00
|
|
|
let layer = new YJ.Obj.ArcgisWXImagery(sdk, {
|
|
|
|
show: true,
|
|
|
|
layer_index: 1
|
|
|
|
});
|
2025-04-29 18:09:13 +08:00
|
|
|
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>
|
2025-05-12 18:31:23 +08:00
|
|
|
@import '../css/gis.scss';
|
2025-04-29 18:09:13 +08:00
|
|
|
.ol-map {
|
2025-05-12 18:31:23 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2025-04-29 18:09:13 +08:00
|
|
|
width: 100%;
|
2025-05-12 18:31:23 +08:00
|
|
|
height: calc(100vh);
|
2025-04-29 18:09:13 +08:00
|
|
|
}
|
|
|
|
</style>
|