오늘 :
9,358 / 22,792
어제 :
20,807 / 187,307
전체 :
20,723,155 / 282,210,072

Open API 공부

Naver, Daum, Google Open API

추천 수 : 10 / 0
조회 수 : 19718
2007.11.30 (11:14:44)


http://www.subkorea.com/api/google/MapsAPI/event-arguments.htm지도 클릭시 중심좌표와 배율표시 (미국 - 줌레벨 0~19까지, 한국 - 줌레벨 서울18, 천안14까지), 콘트롤, 배율 (화살표만)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Event Arguments</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=abc...xyz"
            type="text/javascript"></script>
    <script type="text/javascript">

                
    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);

        GEvent.addListener(map,"click", function(overlay,latlng) {    
          var myHtml = "The GLatLng value is: " + map.fromLatLngToDivPixel(latlng) + " at zoom level " + map.getZoom();
          map.openInfoWindow(latlng, myHtml);
        });
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
      }
    }

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>
</html>

Tag List