ASP.NET Page /Test2.aspx (VB.NET)
1:   
2: <html>  
3: <head>  
4: <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />  
5: <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>  
6: <title>Google Maps JavaScript API v3 Example: Event Closure</title>  
7: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>  
8: <script type="text/javascript">  
9:     var map;  
10:     var infowindowLevel = 0;  
11:   
12:     function initialize() {  
13:         var myLatlng = new google.maps.LatLng(-25.363882, 131.044922);  
14:         var myOptions = {  
15:             zoom: 4,  
16:             center: myLatlng,  
17:             mapTypeId: google.maps.MapTypeId.ROADMAP  
18:         }  
19:   
20:         map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);  
21:   
22:         // Add 5 markers to the map at random locations  
23:         var southWest = new google.maps.LatLng(-31.203405, 125.244141);  
24:         var northEast = new google.maps.LatLng(-25.363882, 131.044922);  
25:         var lngSpan = northEast.lng() - southWest.lng();  
26:         var latSpan = northEast.lat() - southWest.lat();  
27:         for (var i = 0; i < 5; i++) {  
28:             var location = new google.maps.LatLng(southWest.lat() + latSpan * Math.random(),  
29:         southWest.lng() + lngSpan * Math.random());  
30:             var marker = new google.maps.Marker({  
31:                 position: location,  
32:                 map: map  
33:             });  
34:             var j = i + 1;  
35:             marker.setTitle(j.toString());  
36:             attachInfowindow(marker, i);  
37:         }  
38:     }  
39:   
40:     function attachInfowindow(marker, number) {  
41:         var infowindow = new google.maps.InfoWindow(  
42:       { content: "I like to be on top!"  
43:       });  
44:         google.maps.event.addListener(marker, 'click', function () {  
45:             infowindow.setZIndex(++infowindowLevel);  
46:             infowindow.open(map, marker);  
47:         });  
48:     }  
49: </script>  
50: </head>  
51: <body style="margin:0px; padding:0px;" onload="initialize()">  
52:   <div id="map_canvas" style="width:100%; height:100%"></div>  
53: </body>  
54: </html>  

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.