Created
April 7, 2020 09:15
-
-
Save webcorgi/eda9a71b3053f96644ccbc0cc70db0dd to your computer and use it in GitHub Desktop.
[API] 구글지도 사용 (google map API)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
구글지도넣기 | |
본사이트 : https://developers.google.com/maps/documentation/javascript/ | |
<!-- 지도 --> | |
<div class="mapImg"> | |
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAZu1tJ_ciKA2fKQs4Wlf8BOdcwFBodE6I&language=ko®ion=KR"></script> | |
<script> | |
var myCenter=new google.maps.LatLng(35.8971881,128.5813469); | |
function initialize() | |
{ | |
var mapProp = { | |
center:myCenter, | |
zoom:15, | |
mapTypeId:google.maps.MapTypeId.ROADMAP | |
}; | |
var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); | |
var marker=new google.maps.Marker({ | |
position:myCenter, | |
}); | |
marker.setMap(map); | |
var infowindow = new google.maps.InfoWindow({ | |
content:"(주)제이에스멕" | |
}); | |
google.maps.event.addListener(marker, 'click', function() { | |
infowindow.open(map,marker); | |
}); | |
} | |
google.maps.event.addDomListener(window, 'load', initialize); | |
</script> | |
<div id="googleMap"></div> <- height 넣어줘야함 !! | |
</div><!-- //지도 --> | |
1.여기 접속 | |
ID : | |
PW : | |
https://console.developers.google.com/apis/credentials?project=local-disk-135823 | |
->지도 API키 링크에 들어간다. | |
2.등록한다. | |
마지막에 | |
new6.ebiweb.co.kr/* | |
*.new6.ebiweb.co.kr/* | |
두가지를 | |
(도메인주소인거지) | |
->저장한다. 적용하는데 시간이 좀걸릴수 있다. | |
3.구글지도 | |
(지도에 나타낼) 장소 검색 | |
->공유->링크복사(좌표값보기위함임) | |
(or 상단 주소창에 보면 좌표값이 나와있음) | |
-> | |
x,y좌표값을 바꿔준다!!! | |
zoom:15가 적당한듯 | |
13 광범위해짐 | |
17 넘 확대됨 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment