Hi Mike, Thanks very much for your help, I have been learning your examples for long time.
For this case, I changed the every thing according to your suggestion, but the line disappeared. I dont know why, could you please help me take a look what happend? link: http://www.easylocation.ca/example4_1.html Thanks very much Alex 2008/12/26 Mike Williams <[email protected]> > > You need to keep a global reference to the polylines when you create > them. > > Add: > var gpolylines = []; // global > > Replace: > map.addOverlay(new GPolyline(pts,colour,width)); > With: > var poly = new GPolyline(pts,colour,width); > map.addOverlay(poly); > poly.hide(); > gpolylines.push(poly); > > Add: > function boxclick(box,n) { > if (box.checked) { > gpolyline[parseInt(n) - 1].show(); > } else { > gpolyline[parseInt(n) - 1].hide(); > } > } > > Some browsers (e.g. Firefox) remember the .checked state of the > checkboxes when the page is reloaded. You can fix that by unchecking the > boxes from Javascript. > > document.getElementById("001box").checked = false; > document.getElementById("002box").checked = false; > > Actually, "id" attributes should start with a letter, not a number, so > it would be better to write > <input type="checkbox" id="box001" > and since you need the parameter as a number, it's easier to pass the > actual number than convert it and subtract 1 in boxclick() > > <input type="checkbox" id="box001" onclick="boxclick(this,0)" > > > -- > http://econym.org.uk/gmap > The Blackpool Community Church Javascript Team > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
