1. Map zoom control
(1) All-Around control-glargemapcontrol
(2) miniature controls-gsmallmapcontrol
(3) miniature scaling control-gsmallzoomcontrol
2. Map Type Selection Control
(1) gmaptypecontrol
(2) Menu Control-gmenutypecontrol
(3) standard class control-ghierarchicalmaptypecontrol
3. Thumbnail Control -- goverviewmapcontrol
4. Scale Control-gscalecontrol
How to add controls:
Map. addcontrol (New glargemapcontrol ());
Map. addcontrol (New glargemapcontrol (),New gcontrolposition (g_anchor_bottom_right, new gsize (10, 10 )));
Gcontrolposition: an optional parameter;
< Html >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charsets = UTF-8" />
< Script
SRC = "Http://ditu.google.com/maps? File = API & amp; V = 2 & amp; Key = ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA & HL = ZH-CN"
Type = "Text/JavaScript" > </ Script >
< Script Type = "Text/JavaScript" >
Function Load (){
// Check the compatibility of the browser.
If (Gbrowseriscompatible ()){
// Load Map
VaR Map = New Gmap2 (document. getelementbyid ( " Mapcanvas " ));
// Set the central coordinates of the map.
Map. setcenter ( New Glatlng ( 39.990168 , 116.295304 ), 4 );
// Allows users to move and scale a map
Map. addcontrol ( New Gsmallmapcontrol ());
// Allows users to switch between map types
Map. addcontrol ( New Gmaptypecontrol ());
}
}
</ Script >
</ Head >
< Body Onload = "Load ()" OnUnload = "Gunload ()" >
<! -- Map canvas -->
< Div ID = "Mapcanvas" Style = "Width: 640px; Height: 480px" > </ Div >
</ Body >
</ Html >