I use map.showControls() and map.hideControls() to give my map a
"clean look" when the mouse pointer is not "on" the map. This is
useful, especially when you embed the map on a larger page with other
information, so that the map is not cluttered looking in the off
state, and the controls appear only when the user goes to the map.
I have the following controls:
textual zoom controls
custom map type control (using a selector element)
custom application control (also a selector)
Here's two brief snippets of what I do:
//'mouseout' listener hides controls
GEvent.addListener(map, "mouseout", function(){
...
map.hideControls();
});
...
//'mouseover' listener shows controls
GEvent.addListener(map, "mouseover", function(){
,,,
map.showControls();
});
Here is the base line map where the controls always stay put:
http://members.bellatlantic.net/~vze2h6gy/papabear/BM_Station_GMap.html#FILE=EOA_Entire.js&segment=1&index=triangle&title=1&t=ter&width=960&height=720
Note the controls. Also note that when you move the mouse on or off
the map, the controls are not affected . This is your garden variety
map with controls.
Here is the same map where the controls appear or disappear when the
mouse moves on or off the map:
http://members.bellatlantic.net/~vze2h6gy/papabear/BM_Station_GMap.html#FILE=EOA_Entire.js&hideshowctl=1&segment=1&index=triangle&title=1&t=ter&width=960&height=720
For this version, if you move the mouse off the map, the controls
should disappear. Move it back on, they reappear. So far so good.
Now move the mouse over the map and use one of the selectors, for
example, go to the map type selector (upper right) and change the map
type to "map".
My testing shows the following:
Mozilla Firefox (v 3.0.3): controls all work properly
Chrome (latest download): controls all work properly
IE (v 7.0): the selectors do not work. When you click on the one of
the selectors (say the map type selector in the upper right) and then
move the mouse over the selector list to click on a new selection, the
selector list disappears. A similar thing happens if you try the
application custom selector on the left side under the zoom controls.
The zoom controls work as expected.
Safari (v 3.2 for Windows): the selectors do not work. When you click
on one of the selectors (say the map type selector in the upper
right), ALL THE CONTROLS EXCEPT THE SELECTOR LIST disappear. (sort of
the inverse from what IE does). You can then actually click on the
list and get the proper map type at this point. A similar thing
happens if you try the application custom selector on the left side
under the zoom controls. The zoom controls work as expected.
<grin on>
Maybe IBM and Apple should work together to combine their bugs?
<grin off>
My guess is something weird is happening with a selector. such that
certain browsers think the selector of it's list is off the map.
Any ideas would be appreciated.
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---