Custom Google Map V3 Controls Position Issue
Solution 1:
This is happening because Google Maps API needs to know the width
and the height
of your control elements to know where to position them - when the map is rendered. By initially setting them to display: none
, you are hiding it from the actual layout of your page as well - it's as if the element's not there. Use visibility: hidden
instead - setting the visibility
to hidden
will still hide the element on the screen, but it is still present in the layout. For reference: http://www.w3schools.com/css/css_display_visibility.asp
Also, I suggest rather than individually setting these CSS attributes to your custom control elements, add a class (you can do this via jquery's .addClass()
) to these elements and toggle just by targeting the class. I've updated your jsfiddle here.
Post a Comment for "Custom Google Map V3 Controls Position Issue"