carmelyne (owner)

Revisions

gist: 81324 Download_button fork
public
Public Clone URL: git://gist.github.com/81324.git
Embed All Files: show embed
Google Markers with Info Tab #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!-- place in <head> -->
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAZFJWpftMwgnCCqt4vPRS7BR1HFqmY0hOxpFWSoKSv_ILnU21AhRd8Ow1u23lsYZWN5Fo-iaQ72-icQ" type="text/javascript"></script>
 
<!-- place in <head> or inside <body> -->
<script language="Javascript" type="text/javascript">
     //<![CDATA[
 
      function OnLoad() {
 
        // create a search control
        var searchControl = new GSearchControl();
 
        // create a draw options object so that we
        // can position the search form root
        var options = new GdrawOptions();
        options.setSearchFormRoot(document.getElementById("searchForm"));
 
        // populate with searchers
        searchControl.addSearcher(new GwebSearch());
        searchControl.addSearcher(new GvideoSearch());
        searchControl.addSearcher(new GblogSearch());
        
        // site restricted web search with custom label
        // and class suffix
        var siteSearch = new GwebSearch();
        siteSearch.setUserDefinedLabel("Amazon.com");
        siteSearch.setUserDefinedClassSuffix("siteSearch");
        siteSearch.setSiteRestriction("amazon.com");
        searchControl.addSearcher(siteSearch);
 
        searchControl.draw(document.getElementById("searchResults"), options);
        searchControl.execute("");
      }
      GSearch.setOnLoadCallback(OnLoad);
    //]]>
</script>
 
<!-- the div where the map will be displayed -->
 
  <div id="map" style="width: 605px; height: 325px; margin-left:10px;"></div>
 
<!-- End div where the map will be displayed -->
 
<!-- handles markers -->
<script type="text/javascript">
//<![CDATA[
 
 
  if (GBrowserIsCompatible()) {
   var map = new GMap2(document.getElementById("map"));
   map.addControl(new GSmallMapControl());
   map.addControl(new GMapTypeControl());
   map.setCenter(new GLatLng(41.883856,-87.624958), 15);
 
   // Our info window content
   var infoTabs = [
   new GInfoWindowTab("HTML text possible inside quotes"),
   new GInfoWindowTab("Location", "<br /><strong><a href='#' class='red'>Chicago Cultural Center </a></strong><br /> 78 E. Washington St. <br />Chicago IL 60602 <br/><br/><a href='http://maps.google.com/maps?saddr=&daddr= 78 E. Washington St.,Chicago,IL,60602' target ='_blank' class='blue'>Get directions via Google</a>")
   ];
 
   // Place a marker in the center of the map and open the info window
   // automatically
   var marker = new GMarker(map.getCenter());
   GEvent.addListener(marker, "click", function() {
   marker.openInfoWindowTabsHtml(infoTabs);
   });
   map.addOverlay(marker);
   marker.openInfoWindowTabsHtml(infoTabs);
  }
 
 
//]]>
</script>