Saludo... Llevo 2 meses tratando de obtener una solucion que me
permita realizar lo siguiente:
Tengo 3 layers (Archivos KML) y quisiera asociar cada uno a un check
box, para que cada vez que active uno se active el respectivo Kml
dentro de mi mapa.
Hasta el momento he realizado lo siguiente viendo los ejemplos de la
API. Alguien por favor ayúdemeee....
var map;
var geoXml;
var toggleState = 0;
var layer = "http://www.midas.org.co/simproject/newsletter/maps/kml/
Abc.kml";
function initialize() {
if (GBrowserIsCompatible()) {
geoXml = new GGeoXml(layer);
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(4.5849639,-72.641439), 6);
map.addControl(new GLargeMapControl());
map.addControl(new GLargeMapControl());
map.addOverlay(geoXml);
}
}
function toggleMyKml() {
if (toggleState == 1) {
map.removeOverlay(geoXml);
toggleState = 0;
} else {
map.addOverlay(geoXml);
toggleState = 1;
}
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 640px; height: 480px;
float:left; border: 1px solid black;"></div>
</div>
<br clear="all"/>
<br/>
<input type="checkbox" value="abc" onClick="toggleMyKml();"/
><b>CheckBox</b>
<br/>
</body>
AGRADEZCO ANTICIPADAMENTE.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---