Tag - 지도

현재 위치 구하기 (PHP)

geolocation 함수를 통해 위치를 구하고, 만약 관련 권한 및 지원하지 않는 브라우저인 경우 네이버에서 제공하는 API 를 통해 아이피로 위치를 구한다. 사용 전 아래 주소로 네이버의 API키를 받는다.(https://www.ncloud.com/product/applicationService/geoLocation) <? function makeSignature($secretKey, $method, $baseString, $timestamp, $accessKey) { $space = ' '; $newLine = "\n"; $hmac = $method.$space.$baseString.$newLine.$timestamp.$newLine.$accessKey; $signautue = base64_encode(hash_hmac('sha256', $hmac, $secretKey,true)); return $signautue; } if($_POST['order'] == 'geolocation') { $hostNameUrl = 'https://geolocation.apigw.ntruss.com'; $requestUrl= '/geolocation/v2/geoLocation'; $accessKey...