Three basic hints: 1: Try to write valid html using a valid doctype.
2. Try to declare all your global variables as global and distinguish clearly between local and global variables. 3. Try to find out whats wrong here var posLat = "40.8"; var posLon = "-73.9"; var radio = "92"; var CentroMapa = new google.maps.LatLng(posLat, posLon); when the docs say that a LatLng object expects two numbers as argument - not strings. On Jan 31, 12:16 pm, VolksNav <volks...@volksnav.de> wrote: > Hi, > > I'm passing to V3, could solve difficult tasks - seewww.volksnav.de/iNY- > but until now it wasn't possible to delete an overlay through a button, see > > www.volksnav.de/PLZv3test/indexSimple.htm > > and the following code. Can anybody help? Thank you in advance > > VolksNav > > ---------------- > > <html> > <head> > <meta name="viewport" content="initial-scale=1, user-scalable=no" /> > <script type="text/javascript" > src="http://maps.google.com/maps/api/js?sensor=false"></script> > <script type="text/javascript"> > > var map; > > function initialize() { > > var centroMapa = new google.maps.LatLng(48.1375, 11.5757); > var myOptions = { zoom: 16, center: centroMapa, mapTypeId: > google.maps.MapTypeId.ROADMAP } > var map = new google.maps.Map(document.getElementById("map_canvas"), > myOptions); > > var Circulo = new google.maps.Circle({ center: centroMapa, radius: > 300, strokeColor: "#FF0000",strokeWeight: 3, fillOpacity: 0 }); > > Circulo.setMap(map); > > // just for information: > > // doesn't work: setTimeout(deleteCirculo(), 3000); > // OK: setTimeout(deleteCirculo, 3000); > // OK: google.maps.event.addListener(map, 'click', function() > {Circulo.setMap(null);}); > // OK: google.maps.event.addListener(map, 'click', > function(){deleteCirculo();}); > // OK: deleteCirculo(); > > function deleteCirculo() { > Circulo.setMap(null); > }; > > } // initialize > > </script> > </head> > > <body onload="initialize()"> > <div id="map_canvas" style="width:60%; height:60%"></div> > > <input type="button" value="show grid" onclick="map.Circulo.setMap(null)"; > /> > > <!-- > on V2 this was OK: onClick="map.clearOverlays()" > > Also not working: > <input type="button" value="delete grid" onclick="deleteCirculo"; /> > <input type="button" value="delete grid" onclick="deleteCirculo()"; > > <input type="button" value="delete grid" onclick="Circulo.setMap(null)"; > > <input type="button" value="delete grid" onclick="Circulo.set_map(null)"; > > <input type="button" value="delete grid" > onclick="map.Circulo.set_map(null)"; > > --> > > </body> > </html> -- 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 google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.