I have just started upgrading my application from Google maps v2 to
v3, and I have a question regarding the new way to handle custom map
controls:

At application start-up I first create a couple of custom controls and
attach them to the map. I then call the jQuery method $
("#myControlDiv").hide() in order to hide them (They will be activated
later). This does not seem to work properly, however. The controls are
all visible at application startup. I have put a breakpoint at the
call to hide(), and it seems that jQuery cannot find a div with that
ID at that point in time. In v2 I used map.removeControl(..) and
map.addControl(..) instead of the jquery show/hide, but as far as I
could read from the API this approach was not possible anymore.

Also, when I try to show() and hide() the controls _later_ in the
application it works fine! Does anyone know if there is a better way
of disabling/enabling custom controls, or if there is a simple fix I
can apply to the code I have now? It seems to me that the actual div-
element is created after I try to hide it, even though
document.createElement(..) is called before I run hide().

-- 
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.

Reply via email to