can add a line on the map using GPolyline. I am having the hardest
time removing it.
I want to have a radio button that will show the lines and I want it
to toggle on and off.
I have simplified my code but when I run it in a map, it never deletes
the line. In fact, it never drops to my final alert box "just
executed" either.
if anyone has some sample code that would be wonderful . . .
Thanks.
HG
//Begin function radio1_onclick
function radio1_onclick(ctrl) {
var polyOptions = {geodesic:true};
if(radio1_0.checked == true)
{
var polyline = new GPolyline([
new GLatLng(40.65642, -73.7883),
new GLatLng(61.1699849, -149.944496)
], "#ff0000", 10, 1, polyOptions);
getMapObject('googlemap1').map.addOverlay(polyline);
}
if(radio1_0.checked == false)
{
alert('going to remove it');
var polyline = new GPolyline.hide([
new GLatLng(40.65642, -73.7883),
new GLatLng(61.1699849, -149.944496)
], "#ff0000", 10, 1, polyOptions);
alert('about to execute line');
getMapObject('googlemap1').map.addOverlay(polyline);
alert('just executed');
}
}
//End function radio1_onclick
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---