오늘 :
16,597 / 82,990
어제 :
20,767 / 234,356
전체 :
20,448,942 / 279,724,240

Open API 공부

Naver, Daum, Google Open API

cyber
추천 수 : 16 / 0
조회 수 : 17447
2007.11.30 (12:48:33)


http://www.subkorea.com/api/google/MapsAPI/marker-3exp.html3개의 마크위치와 마크 클릭시 윈도우설명

<!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</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=abc...xyz" type="text/javascript"></script>
  </head>
  <body onunload="GUnload()">

    <div id="map" style="width: 550px; height: 450px"></div>
    <a href="basic1.htm">Back to the tutorial page</a>


    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
      However, it seems JavaScript is either disabled or not supported by your browser.
      To view Google Maps, enable JavaScript by changing your browser options, and then
      try again.
    </noscript>


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

      // A function to create the marker and set up the event window
      // Dont try to unroll this function. It has to be here for the function closure
      // Each instance of the function preserves the contends of a different instance
      // of the "marker" and "html" variables which will be needed later when the event triggers.    
      function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(43.907787,-79.359741),8);
    
      // Set up three markers with info windows
    
      var point = new GLatLng(43.65654,-79.90138);
      var marker = createMarker(point,'<div style="width:240px">Some stuff to display in the First Info Window. With a <a href="http://www.econym.demon.co.uk">Link</a> to my home page</div>')
      map.addOverlay(marker);

      var point = new GLatLng(43.91892,-78.89231);
      var marker = createMarker(point,'Some stuff to display in the<br>Second Info Window')
      map.addOverlay(marker);

      var point = new GLatLng(43.82589,-79.10040);
      var marker = createMarker(point,'Some stuff to display in the<br>Third Info Window')
      map.addOverlay(marker);

    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/  
    // http://econym.googlepages.com/index.htm

    //]]>
    </script>
  </body>

</html>

번호 제목 닉네임 등록일 조회 추천
32 marker-tabbed 첨부 파일
cyber
2007-11-30 16256 12
31 marker-manager 첨부 파일
cyber
2007-11-30 17843 20
30 marker-maptips3 첨부 파일
cyber
2007-11-30 17638 3
29 marker-maptips2 첨부 파일
cyber
2007-11-30 14674 9
28 marker-maptips 첨부 파일
cyber
2007-11-30 19872 6
27 marker-window 첨부 파일
cyber
2007-11-30 16813 16
Selected marker-3exp 첨부 파일
cyber
2007-11-30 17447 16
25 markermanager-googleoffices 첨부 파일
cyber
2007-11-30 14884 11
24 markermanager-weathermap 첨부 파일
cyber
2007-11-30 18135 11
23 icon-geicons 첨부 파일
cyber
2007-11-30 17978 20
Tag List