This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

dabeeomaps_api4_directions
TypeScript icon, indicating that this package has built-in type declarations

2.7.2 • Public • Published

dabeeomaps_library_directions

dabeeomaps api 4 directions server

description

  • node server와 typescript로 개발
  • dist: npm publish 에서 사용하는 폴더
  • build: node server용 폴더
  • make: npm publish 전용 빌드

get started

  • npm run dev : 개발 모드
  • npm run reload:stage : 서버 재실행 (stage시 실행)
  • npm run build : build (stage시 실행)
  • npm run start : build 실행
  • npm run dist : npm 에 배포하기 위한 준비. (release시 실행됨)
  • npm run test : jest를 통한 test. npm run start 또는 npm run dev를 한 상태에서 실행해야 함.

npm publish

https://github.com/dabeeo/dabeeomaps_library_navigation/pkgs/npm/dabeeomaps_api4_navigation (deprecated)

https://www.npmjs.com/package/dabeeomaps_api4_directions

Version History

  • 1.0.0 : 내비게이션 node js로 구축
  • 1.1.0 : waypoints cloneDeep
  • 1.1.6 : npm publish
  • 1.2.2
    • @2023.03.23
    • node의 transcode가 존재하는 경우 실제 층이 변경안될 때도 distance를 0으로 하는 오류 수정
    • CR
  • 1.3.1
  • 1.4.1
    • @2023.03.29
    • refactoring getPath(), getDistance()
  • 1.5.1
    • @2023.03.30
    • 지도간 경로찾기
  • 1.6.1
    • @2023.04.20
    • instance infinite->1
  • 1.7.1
    • @2023.05.15
    • Indoor Position Module 추가
  • 1.8.1
    • @2023.06.09
    • Indoor Position Module 제거
  • 2.0.0
    • @2023.07.14
    • 라이브러리 번들링 추가
    • 라이브러리 네이밍 수정
      • dabeeomaps_api4_navigation -> dabeeomaps_api4_directions
  • 2.0.1
    • @2023.07.14
    • npm release auto test
  • 2.1.1
    • @2023.09.25
    • 응답속도 개선 위해 lru cache 적용
      • version 확인하여 version update시 다시 데이터 받기
      • 낮은 version이 있는 경우 삭제
      • 최대 100개 지도, 최대 1000개 층까지 cache
      • 30분 경과시 ttl, 그러나 cache에서 일부러 삭제하지는 않음.
  • 2.2.1
    • @2023.09.26
    • 경로에 poi 포함안되는 이슈 해결
    • /v2/navigation/get-distance에도 lru cache 적용
    • lru cache에서 ttl option 제거 (ttl 동작안함)
  • 2.3.1
    • @2023.10.12
    • 간헐적으로 경로에 poi 포함안되는 이슈 해결
  • 2.4.1
    • @2023.11.08
    • token error handling
  • 2.5.1
    • @2023.11.20
    • 출발지의 좌표가 노드가 아닌 경우 출발지와 노드를 연결하고 이에 따른 노드 추가 및 변경 (gps event 오류)
  • 2.6.1
    • @2023.11.21
    • 경로의 길이 잘못 계산하는 문제 수정
    • 층이동수단과 연결된 노드를 단순히 지나는 경우에도 층변경으로 인식하는 오류 수정
  • 2.7.2
    • @2024.01.10
    • 출발지 노드와 도착지 노드가 동일한 경우 처리
    • console.log 정리

NavigationRequest

  • 내비게이션 생성 객체
  • 생성자
let req = new navigation.NavigationRequest(mapInfo, ComputingType.RECOMMENDATION);
  • 인자 설명
    • mapInfo : 지도 조회 V2 api 를 통해 얻은 정보 전체
    • computingType : RECOMMENDATION(추천경로), SAFETY (안전경로 - 엘리베이터만 이용한 경로)

DijkstraNavigationManager

  • 다익스트라 내비게이션 매니저 생성
let navi = new navigation.DijkstraNavigationManager(req);
  • 출발, 경유지, 목적지 생성
locations = {
        computingTypeList: ['RECOMMENDATION'],
        locations: [
            {
                poiId: 'PO-4JvSQCWHC2270', // 남자화장실 (11층)
                floorId: 'FL-t4vqgyek3jnb8146',
            },
            {
                poiId: 'PO-NMvw3E0pe1690', // 플랫폼사업부 회의실 (11층)
                floorId: 'FL-t4vqgyek3jnb8146',
            },
            {
                poiId: 'PO-WgCv1-qBo8094', // 사업전략부 (11층)
                floorId: 'FL-t4vqgyek3jnb8146',
            },
            {
                poiId: 'PO-M02DvTVjp8449', // 회의실1 (11층)
                floorId: 'FL-t4vqgyek3jnb8146',
            },
        ],
    },
    ```

-   내비게이션에 경로를 뽑을 목적지들을 전달하여 경로 추출

```javascript
let routes = [destination1, origin, destination, destination3, destination2];
let response = navi.getPath(routes);

응답 정의

  • locations : 예상 경로 위치 배열
    • position : 위치 좌표
    • floorId : 층 아이디
    • nodeId : 노드 아이디
    • destination : 경유지 여부 (출발/도착 포함)
    • distance : 이전 노드부터 현재 노드까지 거리 (cm)
    • idx: 인덱스
    • transCode: 이동수단 코드 (실제로 타층과 연결된 경우에만 표시)
      • OB-ELEVATOR : 엘리베이터
      • OB-ESCALATOR : 에스컬레이터 양방향
      • OB-ESCALATOR_UP : 에스컬레이터 상행
      • OB-ESCALATOR_DOWN : 에스컬레이터 하행
      • OB-STAIRS : 계단
    • direction : 현재 노드에서 다음 노드까지의 방향
      • LEFT : 좌회전
      • RIGHT : 우회전
      • STRAIGHT : 직진
  • pathInfo : 경로 안내 정보 (with simplify)
  • totalDistance : 예상 총 이동거리 (cm)
  • totalTime : 예상 이동 시간 (milliseconds)
  • origin : 출발지 위치 정보
  • finalDestination : 최종 목적지 위치 정보
  • wayPoints : 경유지들 위치 정보

Readme

Keywords

none

Package Sidebar

Install

npm i dabeeomaps_api4_directions

Weekly Downloads

4

Version

2.7.2

License

ISC

Unpacked Size

128 kB

Total Files

35

Last publish

Collaborators

  • dabeeo