I'm not sure why you aren't able to resolve those "Method 1, 2 3" links
- but I can include the JavaScript source code from the example I put
together here:
(function(){ function generateRandomPoints() { var points = []; for
(var i=0;i<10;i++) { var somePoints = []; for (var k=0;k<50;k++) { var
lat = Math.floor(Math.random()*90); var lng =
Math.floor(Math.random()*180); somePoints.push(new
google.maps.LatLng(lat, lng)); } points[i] = somePoints; } return
points; } $(document).ready(function(){ var map = new
google.maps.Map(document.getElementById("MAP"), { zoom:3, center: new
google.maps.LatLng(50, -90), mapTypeId: google.maps.MapTypeId.TERRAIN,
backgroundColor: "#99B3CC", keyboardShortcuts:false }); var poly = new
google.maps.Polygon({ paths: generateRandomPoints(),
strokeColor: "#000000", strokeOpacity: 0.0, strokeWeight: 1,
fillColor: "#00FF00", fillOpacity: 1 }); poly.setMap(map);
window.setInterval(function(){ /* Method 1 - Use API Provided
setPaths */ poly.setPaths(generateRandomPoints()); /* Method 2 - Assign
Polygon Object to A New One */ /* poly.setMap(null); poly = new
google.maps.Polygon({ paths: generateRandomPoints(),
strokeColor: "#000000", strokeOpacity: 0.0, strokeWeight: 1,
fillColor: "#00FF00", fillOpacity: 1 }); poly.setMap(map); */ /* Method
3 - Assign New Path Using API Provided Set Options */ /*
poly.setOptions({ paths:generateRandomPoints() }); */ },
3000); }); })();
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.