Thanks John. It worked. Now I am using arrays to handle KML layers in onLoad function. Thanks once again.
On Tue, Oct 26, 2010 at 5:30 PM, John M Phillips <[email protected]> wrote: > The following line should be in the onload block not in the toggle > function: > nearKMLLayer = new google.maps.KmlLayer(layers[id].url > > This line of code is creating a new object every time the function > is called. The first time the function is called a layer is created > and then mapped. The second time a second layer is created > and never mapped, but the first layer is left untouched. > > On Oct 26, 7:25 am, yatri <[email protected]> wrote: >> Hello, >> I am attempting to create google maps from many kml layers. >> Seehttp://www.myworldone.net/nira3.html. >> I am able to switch on the KmlLayer from the checkbox input but unable >> to switch off the layer. >> Please suggest where I am going wrong. >> Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" 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-js-api-v3?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
