var map; var geoXml; var toggleState = 1; function initialize_map() { if (GBrowserIsCompatible()) { geoXml = new GGeoXml("http://www.mantixweb.nl/nodemap/example.kml?tijd=10342"); map = new GMap2(document.getElementById("mapcanvas")); map.setCenter(new GLatLng(52.162687, 4.493294), 11); map.setUIToDefault(); map.addOverlay(geoXml); } } function toggleMyKml() { if (toggleState == 1) { map.removeOverlay(geoXml); toggleState = 0; } else { map.addOverlay(geoXml); toggleState = 1; } }