오늘 :
6,436 / 54,632
어제 :
9,122 / 88,106
전체 :
19,546,498 / 271,603,201

Open API 공부

Naver, Daum, Google Open API

추천 수 : 33 / 0
조회 수 : 28247
2007.11.30 (14:06:35)


http://www.subkorea.com/api/google/MapsAPI/trafficOverlay.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 JavaScript API Example: Traffic Overlays</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=abc...xyz"
      type="text/javascript"></script>
    <script type="text/javascript">

    var map;
    var trafficInfo = new GTrafficOverlay();
    var toggleState = 1;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(40.652513,-73.936615), 12);
        map.addControl(new GSmallMapControl());
        map.addOverlay(trafficInfo);
      }
    }
    
    function toggleTraffic() {
      if (toggleState == 1) {
        map.removeOverlay(trafficInfo);
        toggleState = 0;
      } else {
        map.addOverlay(trafficInfo);
        toggleState = 1;
      }
    }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width: 640px; height: 480px; float:left; border: 1px solid black;"></div>
    <br clear="all"/>
    <br/>
    <input type="button" value="Toggle Traffic" onClick="toggleTraffic();"/>
    <br/>
  </body>
</html>

번호 제목 닉네임 등록일 조회 추천
52 marker-scroll 첨부 파일
cyber
2007-12-03 27543 20
51 directions-advanced 첨부 파일
cyber
2007-11-30 27541 23
50 directions-simple 첨부 파일
cyber
2007-11-30 27871 17
Selected trafficOverlay 첨부 파일
cyber
2007-11-30 28247 33
48 geo-xml 첨부 파일
cyber
2007-11-30 27388 11
47 geoxml-kml 첨부 파일
cyber
2007-11-30 32392 11
46 geoxml-rss 첨부 파일
cyber
2007-11-30 24832 14
45 geocoding-cache 첨부 파일
cyber
2007-11-30 25819 21
44 geocoding-extraction 첨부 파일
cyber
2007-11-30 19974 15
43 geocoding-simple 첨부 파일
cyber
2007-11-30 24765 12
Tag List