• 작성일 작성일 : 17-08-18 16:51 / 조회 : 2,579

구글map 끌어오기

 글쓴이 : 외인 트위터 페이스북 미투데이 C공감


    <script>

$(document).ready(function(){

       google.maps.event.addDomListener(window, ‘load’, initialize);

});

//구글맵시작

function initialize() {

    var latLng = new google.maps.LatLng(37.6526275,127.0608913);

     var homeLatLng = new google.maps.LatLng(37.6526275,127.0608913);


     var map = new google.maps.Map(document.getElementById(‘map’), {

       zoom: 17,

       center: latLng,

       mapTypeId: google.maps.MapTypeId.ROADMAP

     });


     var marker = new MarkerWithLabel({

       position: homeLatLng,

       draggable: true,

       raiseOnDrag: true,

       map: map,

       labelContent: “이젠컴퓨터노원캠퍼스”,

       labelAnchor: new google.maps.Point(22, 0),

       labelClass: “labels” // the CSS class for the label

     });


     var iw = new google.maps.InfoWindow({

       content: “이젠컴퓨터 노원캠퍼스 <br />TEL: 031-951-0008”

     });

     google.maps.event.addListener(marker, “click”, function (e) { iw.open(map, this); });

     /*

     google.maps.event.addListener(marker, “click”, function (e) { log(“Click”); });

     google.maps.event.addListener(marker, “dblclick”, function (e) { log(“Double Click”); });

     google.maps.event.addListener(marker, “mouseover”, function (e) { log(“Mouse Over”); });

     google.maps.event.addListener(marker, “mouseout”, function (e) { log(“Mouse Out”); });

     google.maps.event.addListener(marker, “mouseup”, function (e) { log(“Mouse Up”); });

     google.maps.event.addListener(marker, “mousedown”, function (e) { log(“Mouse Down”); });

     google.maps.event.addListener(marker, “dragstart”, function (mEvent) { log(“Drag Start: ” + mEvent.latLng.toString()); });

     google.maps.event.addListener(marker, “drag”, function (mEvent) { log(“Drag: ” + mEvent.latLng.toString()); });

     google.maps.event.addListener(marker, “dragend”, function (mEvent) { log(“Drag End: ” + mEvent.latLng.toString()); });

*/

}


   function log(h) {

     document.getElementById(“log”)[removed] += h + “<br />”;

   }



      function initMap() {

        var latLng = {lat:37.6526275, lng:127.0608913};

        var map = new google.maps.Map(document.getElementById(‘map’), {

          zoom: 15,

          center: latLng, 

          mapTypeId: google.maps.MapTypeId.ROADMAP   

        });

        var marker = new google.maps.Marker({

          position: latLng,

   labelContent: “이젠노원점”,

          map: map

        });

      }

    </script>

<!—지도 불러오기—>

<script type=“text/javascript” src=“http://maps.googleapis.com/maps/api/js?v=3&sensor=false®ion=KR”></script>

<script type=‘text/javascript’ src=‘js/markerwithlabel.js’></script>

<!—//지도—>


  • 다음글
  • 목록 답변 글쓰기
go top google+ page facebook tistory rss