Guest User

Untitled

a guest
Feb 20th, 2010
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3.  
  4.  
  5. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  6.  
  7.  
  8. <script type="text/javascript">
  9.  
  10.   function initialize() {
  11.   var myLatlng = new google.maps.LatLng(38.707086, -121.280874);
  12.     var myOptions = {
  13.       zoom: 12,
  14.       center: myLatlng,
  15.       mapTypeId: google.maps.MapTypeId.ROADMAP
  16.     }
  17.      
  18.     var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  19.  
  20.     var myCoordinates7418 = [
  21. new google.maps.LatLng(38.730558, -121.392540),
  22. new google.maps.LatLng(38.728818, -121.364559),
  23. new google.maps.LatLng(38.713282, -121.364473),
  24. new google.maps.LatLng(38.713416, -121.366791),
  25. new google.maps.LatLng(38.714286, -121.369366),
  26. new google.maps.LatLng(38.715760, -121.372713),
  27. new google.maps.LatLng(38.716630, -121.374430),
  28. new google.maps.LatLng(38.718304, -121.377691),
  29. new google.maps.LatLng(38.718505, -121.379494),
  30. new google.maps.LatLng(38.718371, -121.381296),
  31. new google.maps.LatLng(38.718237, -121.383699),
  32. new google.maps.LatLng(38.717769, -121.384987),
  33. new google.maps.LatLng(38.716898, -121.386789),
  34. new google.maps.LatLng(38.715827, -121.388678),
  35. new google.maps.LatLng(38.714889, -121.390394),
  36. new google.maps.LatLng(38.714554, -121.391510),
  37. new google.maps.LatLng(38.714353, -121.392282)
  38. ];
  39. var polyOptions7418 = {
  40. paths: myCoordinates7418,
  41. strokeColor: "#ff0000",
  42. strokeOpacity: 1.0,
  43. strokeWeight: 2,
  44. fillColor: "#ff0000",
  45. fillOpacity: 0.1
  46. }
  47. var m7418 = new google.maps.Polygon(polyOptions7418);
  48. m7418.setMap(map);
  49.  
  50.  
  51.  
  52.  
  53.  var toggleState = 1;
  54.  
  55.  function toggle() {
  56.   if (toggleState == 1) {
  57.     m7418.setMap(null);
  58.     toggleState = 0;
  59.   } else {
  60.     m7418.setMap(map);
  61.     toggleState = 1;
  62.   }
  63. }
  64.  
  65. }
  66.  
  67.  
  68. </script>
  69. </head>
  70. <body style="margin:0px; padding:0px;" onload="initialize()" >
  71.   <div id="map_canvas" style="width:100%; height:100%"></div>
  72.     <br/>
  73.     <input type="button" value="Switch on/off polygon" onClick="toggle();"/>
  74.  
  75. </body>
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment