[이윰] Google Maps API Key를 발급받아 이윰 스킨에 적용하기
페이지 정보
루루아빠
5,816
2016.08.24 14:04:29
짧은주소
-
https://yadolee.com/tip/433 주소복사
본문
새로운 구글 맵 API 표준 플랜에 따라 2016년 6월 22일 이후에 만들어지는 모든 신규 애플리케이션에서는 Google Maps API Key가 필요하다. 기존 애플리케이션의 경우 Key 없이도 계속 작동하지만 향후 발생 가능한 문제점을 해결하기 위해 구글 API Key를 발급 받아 적용을 해보도록 하자.
1. 구글 검색을 통해 구글맵 API Key 발급에 대해 많은 정보를 얻어 Key를 https://developers.google.com/maps/documentation/javascript/get-api-key?hl=ko 를 통해 발급받는다.
2. 각 보드 스킨 view.skin.html, view_comment.skin.html, wrtie.skin.html 를 열어 다음과 같이 수정한다.
view.skin.html
수정 전
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
수정 후
<script src="https://maps.googleapis.com/maps/api/js?key=발급_받은_API_Key" type="text/javascript"></script>
view_comment.skin.html에 삽입된 구글맵 스크립트를 주석처리한다.
수정 전
<!--{? eyoom_board.bo_use_addon_map == '1'}-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<!--{/}-->
수정 후
<!--{*? eyoom_board.bo_use_addon_map == '1'*}-->
<!-- <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> -->
<!--{*/*}-->
You have included the Google Maps API multiple times on this page. This may cause unexpected errors. 에러를 방지하기 위함으로 이미 view.skin.html에 동일한 구글맵 스크립트가 추가되었기 때문이다.
wrtie.skin.html
수정 전
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
주성 후
<script src="https://maps.googleapis.com/maps/api/js?key=발급_받은_API_Key" type="text/javascript"></script>
상기 수정으로 콘솔 에러 메세지
"Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys" 와 "Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required" 가 나타나지 않게 된다.
"Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys" 와 "Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required" 가 나타나지 않게 된다.
추천인
레벨 101
경험치 1,519,440
Progress Bar 14.66%
- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS
BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑
루루아빠랍니다~~
최신댓글이 없습니다.


댓글
첫 번째 댓글을 남겨 주세요