오늘 :
4,896 / 42,152
어제 :
11,673 / 102,916
전체 :
19,652,844 / 272,561,823

Open API 공부

Naver, Daum, Google Open API

추천 수 : 8 / 0
조회 수 : 16578
2007.11.30 (13:51:11)


http://www.subkorea.com/api/google/MapsAPI/tile-detector.htm콘트롤, 지도 버튼, 클릭시 위도.경도와 좌표표시  

예) 천안시 에덴부동산  

Latitude: 36.801244157814295  
Longitude: 127.13284492492676  

The Tile Coordinate is:  
x: 13977  
y: 6388  

at zoom level 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: Tile Detector</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.88, -122.442626), 10);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

        GEvent.addListener(map,"click", function(overlay,latlng) {
          if (overlay) {
            // ignore if we click on the info window
            return;
          }
          var tileCoordinate = new GPoint();
          var tilePoint = new GPoint();
          var currentProjection = G_NORMAL_MAP.getProjection();
          tilePoint = currentProjection.fromLatLngToPixel(latlng, map.getZoom());
          tileCoordinate.x = Math.floor(tilePoint.x / 256);
          tileCoordinate.y = Math.floor(tilePoint.y / 256);
          var myHtml = "Latitude: " + latlng.lat() + "<br/>Longitude: " + latlng.lng() +
            "<br/>The Tile Coordinate is:<br/> x: " + tileCoordinate.x +
            "<br/> y: " + tileCoordinate.y + "<br/> at zoom level " + map.getZoom();        
          map.openInfoWindow(latlng, myHtml);
        });
      }
    }
    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>
</html>

번호 제목 닉네임 등록일 조회 추천
42 xhr-requests 첨부 파일
cyber
2007-11-30 17471 6
41 overlay-custom 첨부 파일
cyber
2007-11-30 19488 12
Selected tile-detector 첨부 파일
cyber
2007-11-30 16578 8
39 tileoverlay-simple 첨부 파일
cyber
2007-11-30 17431 8
38 groundoverlay-simple 첨부 파일
cyber
2007-11-30 17202 12
37 polygon-simple 첨부 파일
cyber
2007-11-30 17374 16
36 polyline-encoding 첨부 파일
cyber
2007-11-30 20552 6
35 polyline-geodesic 첨부 파일
cyber
2007-11-30 20516 8
34 polyline-simple 첨부 파일
cyber
2007-11-30 20932 6
33 marker-textfiles 첨부 파일
cyber
2007-11-30 18668 23
Tag List