Anonymous user  |  Log in  |  Create Account

Extra controls

The "extra controls" are those made specifically for Subgurim Maps Control. They do not come as part of the GoogleMaps API.

In some cases Google provides similar items. Given the case we will remove this control in favor of the official one.

For the extra controls, initialize the GControl with an element of the GControl.extraBuilt enum (see how in the code example). Until the present version we were using these types of extraBuilt controls:

  • TextualZoomControl: Adds two text boxes that control zoom in and out.
  • NumericalZoomControl: Adds two text boxes that control zoom in and out using the number of the zoom as the text.
  • TextualCoordinatesControl: Adds a text box with the coordinates of the central point of the map. It is updated as the map crawls. When the box is clicked, the window shows the exact coordinates where we are.
  • TextualOnClickCoordinatesControl: Adds a text box with the coordinates of the point last clicked-on in the map. When the box itself is clicked, a window shows the exact coordinates where we are.
Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
GControl control = new GControl(GControl.extraBuilt.NumericalZoomControl);
GMap1.Add(control);

GMap1.Add(new GControl(GControl.extraBuilt.TextualCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Bottom_Right)));
GMap1.Add(new GControl(GControl.extraBuilt.NumericalZoomControl, new GControlPosition(GControlPosition.position.Top_Left)));
Powered by Subgurim.NET