aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/geolocation
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/api/geolocation')
-rw-r--r--files/ko/web/api/geolocation/clearwatch/index.html92
-rw-r--r--files/ko/web/api/geolocation/getcurrentposition/index.html88
-rw-r--r--files/ko/web/api/geolocation/index.html70
-rw-r--r--files/ko/web/api/geolocation/watchposition/index.html99
4 files changed, 349 insertions, 0 deletions
diff --git a/files/ko/web/api/geolocation/clearwatch/index.html b/files/ko/web/api/geolocation/clearwatch/index.html
new file mode 100644
index 0000000000..b58c9b7738
--- /dev/null
+++ b/files/ko/web/api/geolocation/clearwatch/index.html
@@ -0,0 +1,92 @@
+---
+title: Geolocation.clearWatch()
+slug: Web/API/Geolocation/clearWatch
+tags:
+ - API
+ - Geolocation API
+ - Method
+ - Reference
+ - Secure context
+ - 위치
+ - 위치정보
+translation_of: Web/API/Geolocation/clearWatch
+---
+<div>{{securecontext_header}}{{ APIref("Geolocation API") }}</div>
+
+<p><strong><code>Geolocation.clearWatch()</code></strong> 메서드는 {{domxref("Geolocation.watchPosition()")}}로 등록한 위치 변화 감지 콜백을 해제합니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">navigator.geolocation.clearWatch(<em>id</em>);</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>id</code></dt>
+ <dd>{{domxref("Geolocation.watchPosition()")}} 메서드가 반환하는 콜백 ID.</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<pre class="brush: js">var id, target, option;
+
+function success(pos) {
+ var crd = pos.coords;
+
+ if (target.latitude === crd.latitude &amp;&amp; target.longitude === crd.longitude) {
+ console.log('Congratulation, you reach the target');
+ navigator.geolocation.clearWatch(id);
+ }
+};
+
+function error(err) {
+ console.warn('ERROR(' + err.code + '): ' + err.message);
+};
+
+target = {
+ latitude : 0,
+ longitude: 0,
+}
+
+options = {
+ enableHighAccuracy: false,
+ timeout: 5000,
+ maximumAge: 0
+};
+
+id = navigator.geolocation.watchPosition(success, error, options);
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Geolocation')}}</td>
+ <td>{{Spec2('Geolocation')}}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("api.Geolocation.clearWatch")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li><a href="/ko/docs/Web/API/Geolocation_API/Using_the_Geolocation_API">Geolocation API 사용하기</a></li>
+ <li>{{domxref("Geolocation")}}</li>
+ <li>{{domxref("Geolocation.watchPosition()")}}</li>
+ <li>{{domxref("Geolocation.getCurrentPosition()")}}</li>
+</ul>
diff --git a/files/ko/web/api/geolocation/getcurrentposition/index.html b/files/ko/web/api/geolocation/getcurrentposition/index.html
new file mode 100644
index 0000000000..ffe4aeae2f
--- /dev/null
+++ b/files/ko/web/api/geolocation/getcurrentposition/index.html
@@ -0,0 +1,88 @@
+---
+title: Geolocation.getCurrentPosition()
+slug: Web/API/Geolocation/getCurrentPosition
+tags:
+ - API
+ - Geolocation
+ - Geolocation API
+ - Method
+ - Reference
+ - Secure context
+ - 위치
+ - 위치정보
+translation_of: Web/API/Geolocation/getCurrentPosition
+---
+<div>{{securecontext_header}}{{ APIRef("Geolocation API") }}</div>
+
+<p><strong><code>Geolocation.getCurrentPosition()</code></strong> 메서드는 장치의 현재 위치를 가져옵니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">navigator.geolocation.getCurrentPosition(<em>success</em>[, <em>error</em>[, [<em>options</em>]])</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>success</code></dt>
+ <dd>{{domxref("GeolocationPosition")}} 객체를 유일한 매개변수로 받는 콜백 함수.</dd>
+ <dt><code>error</code> {{optional_inline}}</dt>
+ <dd>{{domxref("GeolocationPositionError")}} 객체를 유일한 매개변수로 받는 콜백 함수.</dd>
+ <dt><code>options</code> {{optional_inline}}</dt>
+ <dd>{{domxref("PositionOptions")}} 객체.</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<pre class="brush: js">var options = {
+ enableHighAccuracy: true,
+ timeout: 5000,
+ maximumAge: 0
+};
+
+function success(pos) {
+ var crd = pos.coords;
+
+ console.log('Your current position is:');
+ console.log('Latitude : ' + crd.latitude);
+ console.log('Longitude: ' + crd.longitude);
+ console.log('More or less ' + crd.accuracy + ' meters.');
+};
+
+function error(err) {
+ console.warn('ERROR(' + err.code + '): ' + err.message);
+};
+
+navigator.geolocation.getCurrentPosition(success, error, options);
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Geolocation')}}</td>
+ <td>{{Spec2('Geolocation')}}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("api.Geolocation.getCurrentPosition")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li><a href="/ko/docs/Web/API/Geolocation_API/Using_the_Geolocation_API">Geolocation API 사용하기</a></li>
+ <li>{{domxref("Navigator.geolocation")}}</li>
+</ul>
diff --git a/files/ko/web/api/geolocation/index.html b/files/ko/web/api/geolocation/index.html
new file mode 100644
index 0000000000..475c706920
--- /dev/null
+++ b/files/ko/web/api/geolocation/index.html
@@ -0,0 +1,70 @@
+---
+title: Geolocation
+slug: Web/API/Geolocation
+tags:
+ - API
+ - Advanced
+ - Geolocation API
+ - Interface
+ - Reference
+ - Secure context
+ - 위치정보
+translation_of: Web/API/Geolocation
+---
+<div>{{securecontext_header}}{{APIRef("Geolocation API")}}</div>
+
+<p><code><strong>Geolocation</strong></code> 인터페이스는 장치의 위치를 가져오는 방법을 나타냅니다. <code>Geolocation</code>을 사용하면 웹 사이트나 웹 앱이 위치 정보를 활용해, 현재 위치에 대해 맞춤 콘텐츠를 제공할 수 있습니다.</p>
+
+<p>{{domxref("Navigator")}} 객체의 {{domxref("Navigator.geolocation", "geolocation")}} 속성으로 이 인터페이스를 구현하는 객체에 접근할 수 있습니다.</p>
+
+<div class="note">
+<p><strong>참고:</strong> 보안 상의 문제로, 웹 페이지가 위치 정보에 접근을 시도하면 사용자에게 알림을 보내고 권한을 허용할지 묻습니다. 각 브라우저는 자신만의 권한 정책과 요청 방식을 가지고 있으므로 주의해야 합니다.</p>
+</div>
+
+<h2 id="속성">속성</h2>
+
+<p><em><code>Geolocation</code> 인터페이스는 어떤 속성도 구현하거나 상속하지 않습니다.</em></p>
+
+<h2 id="메서드">메서드</h2>
+
+<p><em><em><code>Geolocation</code> 인터페이스는 어떤 메서드도 상속하지 않습니다.</em></em></p>
+
+<dl>
+ <dt>{{domxref("Geolocation.getCurrentPosition()")}} {{securecontext_inline}}</dt>
+ <dd>장치의 현재 위치를 조사한 후 {{domxref("GeolocationPosition")}} 객체로 반환합니다.</dd>
+ <dt>{{domxref("Geolocation.watchPosition()")}} {{securecontext_inline}}</dt>
+ <dd>장치의 위치가 변경될 때마다 호출하는 콜백을 등록합니다. 반환값은 콜백의 식별자로 쓸 수 있는 <code>long</code> 값입니다.</dd>
+ <dt>{{domxref("Geolocation.clearWatch()")}} {{securecontext_inline}}</dt>
+ <dd><code>watchPosition()</code>을 이용해 등록한 특정 콜백을 삭제합니다.</dd>
+</dl>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Geolocation')}}</td>
+ <td>{{Spec2('Geolocation')}}</td>
+ <td>초기 명세.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("api.Geolocation")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li><a href="/ko/docs/Web/API/Geolocation_API/Using_the_Geolocation_API">Geolocation API 사용하기</a></li>
+</ul>
diff --git a/files/ko/web/api/geolocation/watchposition/index.html b/files/ko/web/api/geolocation/watchposition/index.html
new file mode 100644
index 0000000000..0e38ea31ac
--- /dev/null
+++ b/files/ko/web/api/geolocation/watchposition/index.html
@@ -0,0 +1,99 @@
+---
+title: Geolocation.watchPosition()
+slug: Web/API/Geolocation/watchPosition
+tags:
+ - API
+ - Geolocation
+ - Geolocation API
+ - Method
+ - Reference
+ - Secure context
+translation_of: Web/API/Geolocation/watchPosition
+---
+<div>{{securecontext_header}}{{ APIref("Geolocation API") }}</div>
+
+<p><span class="seoSummary">{{domxref("Geolocation")}} 인터페이스의 <strong><code>watchPosition()</code></strong> 메서드는 장치의 위치가 바뀔 때마다 자동으로 호출할 처리기 함수를 등록할 때 사용합니다.</span> 선택적으로 오류 발생 시 사용할 콜백 함수도 지정할 수 있습니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">navigator.geolocation.watchPosition(<em>success</em>[, <em>error</em>[, <em>options</em>]])</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>success</code></dt>
+ <dd>{{domxref("GeolocationPosition")}} 객체를 입력 매개변수로 사용하는 콜백 함수.</dd>
+ <dt><code>error</code> {{optional_inline}}</dt>
+ <dd>{{domxref("GeolocationPositionError")}} 객체를 입력 매개변수로 사용하는 콜백 함수.</dd>
+ <dt><code>options</code> {{optional_inline}}</dt>
+ <dd>위치 감지 설정 옵션을 제공하는 {{domxref("PositionOptions")}} 객체.</dd>
+</dl>
+
+<h3 id="반환_값">반환 값</h3>
+
+<p>등록한 처리기를 식별할 때 사용하는 정수 ID. ID를 {{domxref("Geolocation.clearWatch()")}}에 전달해 등록을 해제할 수 있습니다.</p>
+
+<h2 id="예제">예제</h2>
+
+<pre class="brush: js">var id, target, options;
+
+function success(pos) {
+ var crd = pos.coords;
+
+ if (target.latitude === crd.latitude &amp;&amp; target.longitude === crd.longitude) {
+ console.log('Congratulations, you reached the target');
+ navigator.geolocation.clearWatch(id);
+ }
+}
+
+function error(err) {
+ console.warn('ERROR(' + err.code + '): ' + err.message);
+}
+
+target = {
+ latitude : 0,
+ longitude: 0
+};
+
+options = {
+ enableHighAccuracy: false,
+ timeout: 5000,
+ maximumAge: 0
+};
+
+id = navigator.geolocation.watchPosition(success, error, options);
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Geolocation', '#dom-geolocation-watchposition', 'watchPosition()')}}</td>
+ <td>{{Spec2('Geolocation')}}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("api.Geolocation.watchPosition")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li><a href="/ko/docs/Web/API/Geolocation_API/Using_the_Geolocation_API">Geolocation API 사용하기</a></li>
+ <li>메서드가 속한 {{domxref("Geolocation")}} 인터페이스와, 접근하는 방법인 {{domxref("NavigatorGeolocation.geolocation")}}.</li>
+ <li>처리기를 해제하는 {{domxref("Geolocation.clearWatch()")}} 메서드</li>
+ <li>비슷한 {{domxref("Geolocation.getCurrentPosition()")}} 메서드</li>
+</ul>