I tried manipulating the code you had there into something that works. Things I noticed: you weren't too sure about how to use setTimeout, you did not declare centerLat or centerLng in your moveIt function so it didn't know how to add or subtract them, you tried calling moveIt every 50ms, how about every 1/2 second?
Try this, with your own API key in the place of APIKEY: <html> <head> <script type="text/javascript" src="http://maps.google.com/maps? file=api&v=2&key=APIKEY&sensor=false"></script> <script type="text/javascript"> // this part works function initialize(){ if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setMapType(G_SATELLITE_MAP); var cityNames = new Array( "Columbus Circle, New York, NY", "Brandenburger Tor, Berlin,Germany", "Eiffel Tower, Paris, France" ); var cityShown = 0; var cityShown = Math.round(Math.random()*cityNames.length) var geocoder = new GClientGeocoder(); geocoder.getLatLng( cityNames[cityShown], function (point) { map.setCenter(point, 15);} ); setTimeout(moveIt,500); } // This part hasn't worked for me so far. function moveIt() { var centerLat = map.getCenter().lat(); var centerLng = map.getCenter().lng() - 1; map.setCenter(new GLatLng(centerLat, centerLng), 2); setTimeout(moveIt, 500); } } </script> </head> <body> <span id="map_holder">" <body onload="initialize()" onunload="GUnload()"> </span> <!-- <div id="transbg"></div> //--> <div id="map_canvas" style="width: 100%; height: 100%"></div> </body> </html> -- You received this message because you are subscribed to the Google Groups "Google Maps API" 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-api?hl=en.
