DragZoomControl
El DragZoomControl forma parte del GMaps Utility Library.
Usando el DragZoomControl podremos recuadrar una zona específica del mapa sobre la que se hará un zoom.
Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
DragZoomControl dragZoomControl = new DragZoomControl();
DragZoomOtherOptions dragZoomOtherOptions = new DragZoomOtherOptions();
dragZoomOtherOptions.backButtonEnabled = true;
dragZoomOtherOptions.backButtonHTML = "Go back";
dragZoomOtherOptions.buttonHTML = "Zoom";
dragZoomControl.dragZoomOtherOptions = dragZoomOtherOptions;
DragZoomCallbacks dragZoomCallbacks = new DragZoomCallbacks();
dragZoomCallbacks.buttonclick = "function(){alert('Button Click')}";
dragZoomControl.dragZoomCallbacks = dragZoomCallbacks;
DragZoomBoxStyleOptions dragZoomBoxStyleOptions = new DragZoomBoxStyleOptions();
dragZoomBoxStyleOptions.opacity = 0.5;
dragZoomBoxStyleOptions.fillColor = Color.Red;
dragZoomControl.dragZoomBoxStyleOptions = dragZoomBoxStyleOptions;
GControl dragzoom = new GControl(dragZoomControl, new GControlPosition(GControlPosition.position.Top_Left));
GMap1.Add(dragzoom);