"JQuery 네이버지도API 지오코딩"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
14번째 줄: 14번째 줄:
*query: 원하는 주소 입력(상호는 안됨)
*query: 원하는 주소 입력(상호는 안됨)


<source lang='JavaScript'>
<syntaxhighlight lang='JavaScript'>
<script src='//code.jquery.com/jquery.min.js'></script>
<script src='//code.jquery.com/jquery.min.js'></script>
<script>
<script>
50번째 줄: 50번째 줄:
*/
*/
</script>
</script>
</source>
</syntaxhighlight>


==테스트==
==테스트==
*query: "잉등프구"
*query: "잉등프구"
<source lang='javascript'>
<syntaxhighlight lang='javascript'>
items: Array[1]
items: Array[1]
0: Object
0: Object
70번째 줄: 70번째 줄:
total: 1
total: 1
userquery: "잉등프구"
userquery: "잉등프구"
</source>
</syntaxhighlight>
*query: "이필모배우"
*query: "이필모배우"
<source lang='javascript'>
<syntaxhighlight lang='javascript'>
items: Array[1]
items: Array[1]
0: Object
0: Object
88번째 줄: 88번째 줄:
total: 1
total: 1
userquery: "이필모배우"
userquery: "이필모배우"
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2025년 1월 21일 (화) 15:01 기준 최신판

1 개요[ | ]

네이버 지도 API 지오코딩
  • 주소를 좌표로 변환 가능
예: 서울시 → (126.9783881, 37.5666102)
  • 부가정보: 정확한 주소, 시도, 시군구
  • 일일처리한도 : 웹 100,000(요청횟수), 모바일 5,000(실행횟수)

2 사전작업[ | ]

  • 네이버 지도 API 키 발급
https://developer.naver.com/openapi/register.nhn 참고

3 소스코드[ | ]

  • key: 자신이 발급받은 키 사용
  • query: 원하는 주소 입력(상호는 안됨)
JavaScript
Copy
<script src='//code.jquery.com/jquery.min.js'></script>
<script>
$(function() {
	$.ajax({
		url:'http://openapi.map.naver.com/api/geocode',
		data: {
			key:'자신의API키',
			encoding:'utf-8',
			coord:'LatLng',
			output:'json',
			query:'서울시'
		},
		dataType: 'jsonp',
	}).done(function(data) {
		console.log( data.result );
	});
});
/*
items: Array[1]
	0: Object
		addrdetail: Object
			country: "대한민국"
			dongmyun: ""
			rest: ""
			sido: "서울특별시"
			sigugun: ""
		address: "서울특별시 "
		isRoadAddress: false
		point: Object
			x: 126.9783881
			y: 37.5666102
total: 1
userquery: "서울시"
*/
</script>

4 테스트[ | ]

  • query: "잉등프구"
JavaScript
Copy
items: Array[1]
	0: Object
		addrdetail: Object
			country: "대한민국"
			dongmyun: ""
			rest: ""
			sido: "서울특별시"
			sigugun: "잉등프구"
		address: "서울특별시 잉등프구 "
		isRoadAddress: false
		point: Object
			x: 126.8960076
			y: 37.5264324
total: 1
userquery: "잉등프구"
  • query: "이필모배우"
JavaScript
Copy
items: Array[1]
	0: Object
		addrdetail: Object
			country: "대한민국"
			dongmyun: "이필모배우"
			rest: ""
			sido: "서울특별시"
			sigugun: "잉등프구"
		address: "서울특별시 잉등프구 이필모배우 "
		isRoadAddress: false
		point: Object
			x: 126.929425
			y: 37.528317
total: 1
userquery: "이필모배우"

5 같이 보기[ | ]

6 참고[ | ]

편집자 J Jmnote 122.101.24.109 Jmnote bot 223.38.80.242