구글지도api (google map api)

조회 6,095

구글지도API 입니다.

그냥 편해요 붙여넣기만해도.. 덜덜

 

http://maps.googleapis.com/maps/api/js?sensor=false®ion=EN

 

우선 불러오고..

 

function googleMap(latitude,longitude)
{
 
 var myLatlngc = new google.maps.LatLng(latitude,longitude);
 var myLatlng = new google.maps.LatLng(latitude,longitude);
 var myOptions = {
   zoom: 17,
   center: myLatlngc,
   mapTypeId: google.maps.MapTypeId.ROADMAP    }
 
 var map = new google.maps.Map(document.getElementById("map"), myOptions);
 
 var contentString = '<DIV id=mapTitle>여기는어디?</DIV>';
  
 var infowindow = new google.maps.InfoWindow({
  content: contentString
 });
 
 var marker = new google.maps.Marker({
  position: myLatlng,
  map: map,
 });
 google.maps.event.addListener(marker, 'click', function() {
   infowindow.open(map,marker);
 });
  infowindow.open(map,marker);
 
}

window.onload = function() {
 
 googleMap(좌표1,좌표2);

};

aaa

<div class="map" id="map">
 </div>

#googleMap#googleAPI

📌API·연동 인기 글

목록으로 ›