tmap api잘 아시는분 계신가요? ㅡ.,ㅜ

tmap api잘 아시는분 계신가요? ㅡ.,ㅜ

QA

tmap api잘 아시는분 계신가요? ㅡ.,ㅜ

본문

https://developers.skplanetx.com/apidoc/kor/t-map/course-guide/geojson/ 

 

tmap에서 제공하는 경로안내 api인데요

머리가 나빠서 그런가 한글로 써놨는데도 이해가 가질 않아서요

 

https://apis.skplanetx.com/tmap/routes?version=1&callback={callback} 

 

콜백인자를 던지라는데 밑의 셈플을 넣어봐도 그렇고 결과값을 리턴하질 않네요

사용법 아시는분은 듣는녀석이 무식하니 좀 자세하게 친절하게 답변좀 부탁드립니다. ㅡ,.ㅜ



좋은하루 되세요

이 질문에 댓글 쓰기 :

답변 2


<?php
# CURL 통신
if(!function_exists('SendCurl')) {
	function TmapCurl($key, $url, $data='') {
 
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_HEADER, false);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_TIMEOUT, 60);
		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'appKey: '.$key));
		if($data) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
		$return = curl_exec($ch);
		curl_close($ch);
		return $return;
	}
}
 
 
$Return = TmapCurl('API KEY ', 'https://apis.skplanetx.com/tmap/routes?version=1&callback=', 'endX=14363856.085492350&endY=4178405.946508492&startX=14135591.321772&startY=4518111.822511&reqCoordType=EPSG3857&resCoordType=WGS84GEO&tollgateFareOption=1&roadType=32&directionOption=0&endRpFlag=16&endPoiId=67516&gpsTime=10000&angle=90&speed=60&uncetaintyP=3&uncetaintyA=3&uncetaintyAP=12&camOption=0&carType=0&startName=%EB%A1%AF%EB%8D%B0%EB%B0%B1%ED%99%94%EC%A0%90&endName=%EB%B6%80%EC%82%B0%EC%8B%9C%EC%A4%91%EA%B5%AC%EC%B2%AD&searchOption=0');
print_r(json_decode($Return, true));

 

 

급하게 맹글어 봤습니다. ㅋㅋ

Request Payload
부분위 항목을 넣으면될것 같습니다.


POST /tmap/routes HTTP/1.1 
Host: apis.skplanetx.com
appKey: 1234-5678-9012-3456
Accept-Language: ko 
Content-Type: application/x-www-form-urlencoded
 
endX=14363856.085492350&endY=4178405.946508492&startX=14135591.321772&startY=4518111.822511&reqCoordType=EPSG3857&resCoordType=WGS84GEO&tollgateFareOption=1&roadType=32&directionOption=0&endRpFlag=16&endPoiId=67516&gpsTime=10000&angle=90&speed=60&uncetaintyP=3&uncetaintyA=3&uncetaintyAP=12&camOption=0&carType=0&startName=%EB%A1%AF%EB%8D%B0%EB%B0%B1%ED%99%94%EC%A0%90&endName=%EB%B6%80%EC%82%B0%EC%8B%9C%EC%A4%91%EA%B5%AC%EC%B2%AD&searchOption=0
답변을 작성하시기 전에 로그인 해주세요.
전체 22
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT