본문 바로가기
잡동/API 연동

웹에서 위도 경도값 관련

by 죠부니 2019. 4. 24.
반응형

웹에서 지도 위도경도값관련
https://w3c.github.io/geolocation-api/ 
-> 스펙이니 알려고하면 노답
https://developers.google.com/maps/documentation/javascript/geolocation
-> 구글에서의 설명
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/permissions
-> 웹에서의 권한 갖기

결론 : HTTPS가 있어야 돌아가며 익스같은건좀 버리자

https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API/Using_the_Permissions_API

 

Using the Permissions API

This article provides a basic guide to using the W3C Permissions API, which provides a programmatic way to query the status of API permissions attributed to the current context.

developer.mozilla.org

권한관련 샘플

        // Try HTML5 geolocation.
        if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(function(position) {
            var pos = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
          }, function() {
            
          });
        } else {

        }
      }

반응형

'잡동 > API 연동' 카테고리의 다른 글

네이버지도 API  (0) 2018.11.22
주소검색 도로명주소 API 연동 - 2  (0) 2018.07.16
주소검색 도로명주소 API 연동 - 1  (1) 2018.07.12