오늘 :
4,315 / 36,182
어제 :
11,673 / 102,916
전체 :
19,652,263 / 272,555,853

Open API 공부

Naver, Daum, Google Open API

추천 수 : 12 / 0
조회 수 : 24825
2007.11.30 (13:55:29)


http://www.subkorea.com/api/google/MapsAPI/geocoding-simple.htm위치 검색창을 지도 바깥에 표시, 검색시 마킹된곳 찾아가기

<!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 API Example: Simple Geocoding</title>
    <script src="http://maps.google.com/maps?file=api&v=2.x&key=abc...xyz" type="text/javascript"></script>
    <script type="text/javascript">

    var map = null;
    var geocoder = null;

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

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
    </script>
  </head>

  <body onload="initialize()" onunload="GUnload()">
    <form action="#" onsubmit="showAddress(this.address.value); return false">
      <p>
        <input type="text" size="60" name="address" value="1600 Amphitheatre Pky, Mountain View, CA" />
        <input type="submit" value="Go!" />
      </p>
      <div id="map_canvas" style="width: 500px; height: 300px"></div>
    </form>
  </body>
</html>


번호 제목 닉네임 등록일 조회 추천
52 marker-scroll 첨부 파일
cyber
2007-12-03 27621 20
51 directions-advanced 첨부 파일
cyber
2007-11-30 27635 23
50 directions-simple 첨부 파일
cyber
2007-11-30 27950 17
49 trafficOverlay 첨부 파일
cyber
2007-11-30 28341 33
48 geo-xml 첨부 파일
cyber
2007-11-30 27461 11
47 geoxml-kml 첨부 파일
cyber
2007-11-30 32456 11
46 geoxml-rss 첨부 파일
cyber
2007-11-30 24897 14
45 geocoding-cache 첨부 파일
cyber
2007-11-30 25892 21
44 geocoding-extraction 첨부 파일
cyber
2007-11-30 20025 15
Selected geocoding-simple 첨부 파일
cyber
2007-11-30 24825 12
Tag List