hi, i've modified the code with this two functions:
[code]
google.maps.event.addDomListener(controlUI, 'click', function()
{
if (document.getElementById('Legenda') != null)
nascondi_legenda(legenda);
else mostra_legenda(legenda);
});
function mostra_legenda(legenda)
{
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(legenda);
}
function nascondi_legenda(legenda)
{
map.controls[google.maps.ControlPosition.TOP_RIGHT].pop(legenda);
}
[/code]
but now happens something strange... the first time that I press, the
legend appear; the next time the legend disappear and appear at the
left!
the link at the map is the same...
thanks for supp
On 30 Lug, 16:48, Rossko <[email protected]> wrote:
> > but everytime that i click on this button, a legend will add at the
> > map.
>
> Yes, that is exactly what you have written your code to do.
>
> > I want to click once to show the map and the second time that i click
> > on "Legenda", the legend must disappear!
>
> Then write some code to do that.
> One way would be to test if the legend exists when clicked. If it
> does, remove it. If it doesn't, create it.
> A more elegant way would be to create it only once, and show and hide
> it as needed.
--
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.