관리 메뉴

ㄴrㅎnㅂrㄹrㄱi

Google AJAX Search API 본문

API 관련/API 예제

Google AJAX Search API

님투 2007. 10. 25. 06:33
반응형
사용자 삽입 이미지

http://www.google.com/uds/solutions/localsearch/reference.html

<!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">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Local Search Control for Google Maps - default.html</title>

    <script src="http://maps.google.com/maps?file=api&v=2&key=YOUR-KEY" type="text/javascript"></script>
    <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=YOUR-KEY" type="text/javascript"></script>
    <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>

    <style type="text/css">
      @import url("http://www.google.com/uds/css/gsearch.css");
      @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");

      #map {
        border : 1px solid #979797;
        width : 100%;
        height : 600px;
      }
    </style>

    <script type="text/javascript">
      //<![CDATA[
      function load() {
        if (GBrowserIsCompatible()) {

          // Create and Center a Map
          var map = new GMap2(document.getElementById("map"));
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
          map.addControl(new GLargeMapControl());
          map.addControl(new GMapTypeControl());

          // bind a search control to the map, suppress result list
          map.addControl(new google.maps.LocalSearch());
        }
      }
      GSearch.setOnLoadCallback(load);
      //]]>
    </script>
  </head>
  <body onunload="GUnload()">
    <div id="map"></div>
  </body>
</html>
반응형
Comments