¡Ayúdanos a traducir esta Web y consigue licencias gratis!
Usuario anónimo  |  Ingresar  |  Regístrate

Asignar Centro

Para asignar el centro utilizaremos el método setCenter()
Éste tiene tres sobrecargas:
  • setCenter(GLatLng): sólo marcamos el centro
  • setCenter(GLatLng, int): marcamos el centro y el zoom
  • setCenter(GLatLng, int GMapType.GTypes): el centro, el zoom y el tipo de mapa.
Nota: las variables del tipo GLatLng pueden sumarse y restarse con los operadores '+' y '-'.




Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
GLatLng latlong = new GLatLng(15.2, 10.9);
GMapType.GTypes maptype = GMapType.GTypes.Hybrid;
//GMap1.setCenter(latlong);
//GMap1.setCenter(latlong, 4);
GMap1.setCenter(latlong, 4, maptype);

GMap1.addControl(new GControl(GControl.extraBuilt.MarkCenter));
GMap1.addControl(new GControl(GControl.extraBuilt.TextualCoordinatesControl));
Powered by Subgurim.NET