This is a demo of the MapTypeMenuControl, a user interface element for choosing the map type in mapping applications built with the Google Maps API. It is a compact replacement for Google's GMapTypeControl for use in very small maps or applications that have so many different map types that the normal control is too large.
The control listens to addmaptype and removemaptype events so when you add or remove a new map type the menu will automatically update iteslf to reflect the change. The menu object is map.mapTypeMenuObject, so you can use the YUI menu library to extend the menu.
Here's what you need to do to use the control in your own Google Maps API map.
Do this to get something working quickly that's not going to get a lot of traffic. This method uses source files hosted on my server.
<script type="text/javascript" src="http://maps.tafoni.net/MapTypeMenuControl/MapTypeMenuControl-load.js"> </script>
MTMC.addMapControl(map, new MTMC.MapTypeMenuControl());
If your application generates a lot of traffic you should host the files on your own server. In place of step one above, do the following.
<link rel="stylesheet" type="text/css" href="MapTypeMenuControl.css"/> <script type="text/javascript" src="yahoo-dom-event.js"></script> <script type="text/javascript" src="container_core-min.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript" src="MapTypeMenuControl.js"></script>
-- Dawn Endico