Hi,
I'm passing to V3, could solve difficult tasks - see www.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 view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/Xmsoraw6Y7oJ.
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.