길찾기 경로를 지도에 표현합니다.
mapData.getRoute() 를 호출하여 반환된 NavigationResponse 데이터
길찾기 옵션. 출발지, 경유지, 도착지의 아이콘 및 주행선 옵션을 설정할 수 있습니다.
적용된 옵션값
const naviOption = {
defaultLineOption: { // 기본 주행선 옵션
lineColor: string, // navigation 주행 라인의 색상을 지정
lineSpotSize: number, // 주행선의 점의 굵기를 지정합니다. 주행선의 속성이 점선일 경우 적용됩니다.
lineSpotInterval: number, // 주행선의 점간의 간격을 지정합니다. 숫자가 커질수록 점선에 가깝게 보입니다.
lineSpotAnimate: boolean, // 점선 애니메이션 활성화 여부
lineSpotAnimateSpeed: number, // 점선 애니메이션 속도
solidLineEnabled: boolean, // 주행라인의 속성을 결정합니다. false일 때는 점선, true일 때는 실선으로 그려집니다. default는 false.
solidLineWidth: number, // 실선의 굵기입니다. default는 1
solidLineJoin: string, // 실선 접합 부분의 모양을 지정합니다.('round', 'bevel', 'miter')
solidLineCap: string, // 실선 끝 부분 모양을 지정합니다.('round', 'butt')
},
lineDivide: boolean, // 주행선을 경유지 기준으로 분할 여부를 결정합니다.
visibleIcon: boolean, // 경로 표시할때 출발지, 도착지, 경유지 아이콘 없애기 / 보이기
origin: { // 출발지 마커 옵션
markerOptions: { // 출발지 마커 옵션
iconUrl: string, // 출발지 마커 이미지 url
width: number, // 출발지 마커 width
height: number, // 출발지 마커 height
},
},
destination: { // 도착지 마커 및 주행선 옵션
markerOptions: { // 도착지 마커 옵션 (출발지 마커 옵션과 동일)
iconUrl: string,
width: number,
height: number,
},
lineOptions: { // 도착지 주행선 옵션 (기본 주행선 옵션과 동일)
lineColor: string,
lineSpotSize: number,
lineSpotInterval: number,
lineSpotAnimate: boolean,
lineSpotAnimateSpeed: number,
solidLineEnabled: boolean,
solidLineWidth: number,
solidLineJoin: string,
solidLineCap: string,
},
},
wayPoints: [ // 경유지 마커 및 주행선 옵션 배열
{ // 경유지 마커 및 주행선 옵션
markerOptions: { // 경유지 마커 옵션 (출발지 마커 옵션과 동일)
iconUrl: string,
width: number,
height: number,
},
lineOptions: { // 경유지 주행선 옵션 (기본 주행선 옵션과 동일)
lineColor: string,
lineSpotSize: number,
lineSpotInterval: number,
lineSpotAnimate: boolean,
lineSpotAnimateSpeed: number,
solidLineEnabled: boolean,
solidLineWidth: number,
solidLineJoin: string,
solidLineCap: string,
},
},
{
markerOptions: {
iconUrl: string,
width: number,
height: number,
},
lineOptions: {
lineColor: string,
lineSpotSize: number,
lineSpotInterval: number,
lineSpotAnimate: boolean,
lineSpotAnimateSpeed: number,
solidLineEnabled: boolean,
solidLineWidth: number,
solidLineJoin: string,
solidLineCap: string,
},
},
],
};
//응답받은 경로중 선택하여 지도에 표출해야 함
await map.routeSimulation.set(naviResponse.recommendation, naviOption);
길찾기 경로가 표시된 후 경로를 따라 모의주행을 그립니다. 경로를 따라가다가 층이 변경되는 경우 층 변경 전에 "floor-changed" event와 "floor-changing" event가 발생합니다. 옵션 없이 사용할 수도 있고 옵션을 주어 모의주행에 관련된 설정을 할 수도 있습니다. 반드시 비동기 처리를 해주셔야 합니다.
Optional
animOption: INaviAnimOption모의주행 옵션
적용된 옵션값
const animOption = {
zoom: number, // 애니메이션 동작 시 zoom Level
enableTwoFloorsNavigation: boolean // 층변경 애니메이션 후 두개지도 표출 여부
twoFloorsNavigationDuration : number // 층변경 애니메이션 후 두개지도 표출로 넘어가는 시간 ms, default 2000
twoFloorsNavigationOriginCss : string
twoFloorsNavigationDestCSs : string
enableFloorMotionCSS: boolean // 층변경시 애니메이션으로 동작 여부
floorMotionDuration: number // 층변경 애니메이션시 동작 시간 ms. ex 1000 default 3000
changeFloorDelay: number, // 층 변경시 delay time
speedRate: number, // 모의주행 속도 지정. 예를 들어 1.5로 지정한 경우 default대비 1.5배 속도
removeIcon: boolean, // 모의주행 완료 또는 stop 시, 모의주행 icon 제거 옵션. 기본값은 true
markerOptions: { // 모의주행의 icon 옵션
iconUrl: string, // 모의주행의 icon의 url을 지정합니다.
width: number, // 모의주행의 icon의 width값을 설정합니다.
height: number, // 모의주행의 icon의 height값을 설정합니다.
},
};
await map.routeSimulation.start(animOption);
모의주행 API 에 접근할 수 있는 클래스입니다.