root/mapstraction.com/demo-google.html

Revision 103, 4.0 kB (checked in by ajturner, 1 year ago)

Site redesign
Moved primary pages to PHP for common inclusion of header/footer & switch map type based on input parameter.

Line 
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4     <title>Mapstraction - a javascript library to hide differences between mapping APIs.</title>
5     <link rel="stylesheet" type="text/css" href="bluefreedom.css" media="screen" />
6     <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAKRwVKGgdK08PzFOkI4mzwBSxwhHJj4F5mVjLsNT2AfMLlpoynxTk5g96WAoVkzIABODCjMST2qhLwg" type="text/javascript"></script>
7     <script type="text/javascript" src="mapstraction-js/mapstraction.js"></script>
8     <style type="text/css">
9     #mapstraction {
10         height: 400px;
11         width: 400px;
12     }
13     </style>
14
15
16 </head>
17 <body>
18     <div id="wrap">
19         <div id="header">
20
21             <img src="images/mapstraction_icon.png" style="float: right;"/>
22             <h1><a href="#">Mapstraction</a></h1>
23             <h2>Javascript mapping abstraction library</h2>
24
25         </div>
26
27         <div class="middle">
28
29             <div id="mapstraction"></div>
30             <script type="text/javascript">
31             // initialise the map with your choice of API
32             var mapstraction = new Mapstraction('mapstraction','google');
33
34             // create a lat/lon object
35             var myPoint = new LatLonPoint(37.4041960114344,-122.008194923401);
36
37             // display the map centered on a latitude and longitude (Google zoom levels)
38             mapstraction.setCenterAndZoom(myPoint, 15);
39
40             // create a marker positioned at a lat/lon
41             my_marker = new Marker(myPoint);
42
43             my_marker.setIcon('icon.gif');
44             mapstraction.addMarker( new Marker( new LatLonPoint(37.404,-122.008)));
45
46             // add a label to the marker
47             my_marker.setLabel("<blink>H</blink>");
48
49             var text = "<b>South Austin, Texas Rocks!</b>";
50
51             // add info bubble to the marker
52             my_marker.setInfoBubble(text);
53
54             // display marker
55             mapstraction.addMarker(my_marker);
56
57             // open the marker
58
59             my_marker.openBubble();
60
61             mapstraction.addEventListener('click', function(p) { alert('Clicked at ' + p)  });
62
63             ufoo = function() { mapstraction.removeMarker(my_marker); }
64             </script>
65
66 <ul>
67             <li><a onclick="mapstraction.removeAllMarkers();">click me to remove all markers</a>.</li>
68             <li><a onclick="foo();">click me to remove the marker</a>.</li>
69 </ul>       
70 </div>
71
72         <div class="right">
73
74             <h2>Navigation</h2>
75             <ul>
76                 <li><a href="http://mapstraction.com/trac">Documentation</a></li>
77                 <li><a href="http://mapstraction.com/svn/source/mapstraction.js">Download</a></li>
78                 <li><a href="http://mapstraction.com/trac">Trac</a></li>
79                 <li><a href="http://mapstraction.com/svn">Repository</a></li>
80             </ul>
81             <h2>Demos</h2>
82             <ul>
83                 <li><a href="ljn.html">Single Page with all Maps</a></li>
84                 <li><a href="ypolyline/index.html">Line/Polygon</a></li>
85                 <li><a href="mpolyline/index.html">GeoRSS</a></li>
86
87                 <li><a href="demo-openstreemap.html">OpenStreetMap</a></li>
88                 <li><a href="demo-yahoo.html">Yahoo</a></li>
89                 <li><a href="demo-google.html">Google</a></li>
90                 <li><a href="demo-microsoft.html">Microsoft</a></li>
91                 <li><a href="demo-map24.html">Map24</a></li>
92                 <li><a href="demo-multimap.html">MultiMap</a></li>
93                 <li><a href="demo-mapquest.html">MapQuest</a></li>
94             </ul>
95
96         </div>
97
98         <div id="clear"></div>
99
100     </div>
101
102     <div id="footer">
103         Hosted in <a href="http://http://highearthorbit.com">HighEarthOrbit</a> -
104         Design by <a href="http://www.minimalistic-design.net">Minimalistic Design</a>
105     </div>
106 </body>
107 </html>
108
Note: See TracBrowser for help on using the browser.