개발/GIS
[저장용]네이버 길찾기 팝업
Strong_옹이
2022. 11. 24. 16:48
728x90
반응형
네이버 길찾기로 좌표와 이름 넘겨서 길찾기
길찾기 api를 사용하지 않고, 네이버지도로 현재위치 또는 선택한 위치에서 목적지로 가도록 수정
모바일의 경우 시작점을 현위치로 지정할 수 있어 목적지의 좌표만 넘김
목적지명은 이름값만 넘어가고, 좌표로 길찾기 진행
경유지도 설정가능
카카오지도 검색도 유사방식
url = "http://map.naver.com/index.nhn?elng=도착점경도&elat=도착점위도&pathType=1&showMap=true&etext=도착지명&menu=route";
url = "http://map.naver.com/index.nhn?slng=출발지경도&slat=출발지위도&stext=출발지명&elng=도착점경도&elat=도착점위도&pathType=1&showMap=true&etext=도착지명&menu=route";
function naverMapDirections(endX, endY, endNm) {
var url = "";
if (isMobile()) {
url = "http://map.naver.com/index.nhn?elng=도착점경도&elat=도착점위도&pathType=1&showMap=true&etext=도착지명&menu=route";
} else {
url = "http://map.naver.com/index.nhn?slng=출발지경도&slat=출발지위도&stext=출발지명&elng=도착점경도&elat=도착점위도&pathType=1&showMap=true&etext=도착지명&menu=route";
}
window.open(url);
728x90
반응형