Browse Source

Merge branch 'master' of http://gitea.palntour.com/pav/pav-fe-kac into LAANC-QR-CODE

pull/2/head
박상현 10 months ago
parent
commit
442607f908
  1. 3137
      src/assets/images/3dpea.gltf
  2. 49
      src/components/map/mapbox/MapBoxMap.js

3137
src/assets/images/3dpea.gltf

File diff suppressed because one or more lines are too long

49
src/components/map/mapbox/MapBoxMap.js

@ -29,6 +29,9 @@ import { mapInitAction } from '../../../modules/control/map/actions/controlMapAc
import DronPlan from './dron/DronPlan';
import DronToast from './dron/DronToast';
// example 3d gltf 파일
import Gltf from '../../../assets/images/3dpea.gltf';
const uamPosition = {
type: 'FeatureCollection',
features: [
@ -513,12 +516,11 @@ export default function MapBoxMap() {
map.getCanvas().getContext('webgl'),
{
enableSelectingObjects: true,
enableTooltips: true
enableTooltips: true,
defaultLights: true
}
));
map.on('click', e => {
console.log(e);
});
map.on('style.load', () => {
const layers = map.getStyle().layers;
const labelLayerId = layers.find(
@ -626,6 +628,45 @@ export default function MapBoxMap() {
labelLayerId
);
/*************************************************************** 3D UAM Model Layer 추기 코드 start */
// map.addLayer({
// id: 'custom-threebox-model',
// type: 'custom',
// renderingMode: '3d',
// onAdd: function () {
// // 3d model option
// const options = {
// obj: Gltf, // 3D Model 파일
// type: 'gltf', // 3D Model 확장자 타입
// scale: { x: 200, y: 200, z: 200 }, // 3D Model 크기 값
// units: 'meters', // 높이 단위
// rotation: { x: 90, y: -90, z: 0 } // // 3D Model 방향 각도 초기 값
// };
// tb.loadObj(options, model => {
// let longitude = 127.81101412107547; // 3D Model 경도 값
// const latitude = 37.510357; // 3D Model 위도 값
// let hei = 100; // 3D Model 높이 값
// model.setCoords([longitude, latitude, hei]); // 3D Model 위치 지정
// model.setRotation({ x: 0, y: 0, z: 241 }); // 3D Model 방향 각도 지정
// tb.add(model);
// // 0.5초마다 모델의 위치를 변경
// setInterval(() => {
// longitude += 0.001; // 경도를 약간 증가시킵니다.
// hei += 50; // 높이값 증가
// model.setCoords([longitude, latitude, hei]);
// }, 500);
// });
// },
// render: function () {
// tb.update();
// }
// });
/*************************************************************** 3D UAM Model Layer 추기 코드 end */
// 김포 3d 공역
map.addLayer({
id: 'route',

Loading…
Cancel
Save